0

I'm working on creating a mobile app which overlays images on top of a google map.

I have a large number of image overlays ('GroundOverlay' objects in KML-speak). I'm running into several issues (mainly performance) when the map is scrolled or zoomed

Having tried several options, I think my next approach will be to combine all the image overlays into one image beforehand, and then simply display that image as a single overlay on the map. Problem is, I'm not sure where to start.

Does anyone have any experience in combining overlay images?

I think there are two problems that need to be solved 1) Calculate the larger 'bounding box' that will contain the final image. I have the bounding box for each overlay ('LatLngBox' in KML-speak), and I think the final box can be calculated by simply examining the values of each LatLngBox and generating the final box based on the min/max values. Anyone have any insight as to whether this will work?

2) Merge all the overlay images into a single final image. I have no idea where to start here such here. Generating the actual image isn't the problem, but rather where to place each overlay (ie pixel level) so that the resulting image is accurate.

Any tips/hints would be greatly appreciated. Thanks

Billy Johnson
  • 461
  • 3
  • 8

2 Answers2

0

the static overlay images can be combined and drawn. but the moving(regularly updated) overlay images would be an issue if you still want to combine them and post as one. the best option i believe would be to combine the static overlay resources and keep them in one set and other moving images drawn separately.

0

Managed to figure this out on my own.

Answer to (1): The technique I outlined in my question works perfectly Answer to (2): You can convert between lat/lng and x/y pixels of an image as described here: Convert Lat/Longs to X/Y Co-ordinates

Community
  • 1
  • 1
Billy Johnson
  • 461
  • 3
  • 8