Issue
I am currently working on an application that display a custom map (some artist of my city did it) and would like to create on overlay for the city in Google Maps.
So the user would be able to open a MapView with this overlay.
As the graphic file is really huge (12km * 7 km is about 75Mb in a medium/low definition), I succed to do it (here is the code): http://www.androidsnippets.com/drawing-an-image-as-a-map-overlay2
MapView map = (MapView) findViewById(R.id.mapview);
MapController mapController = map.getController();
List<Overlay> overlays = map.getOverlays();
overlays.add(new DrawableMapOverlay(this, point, R.drawable.my_drawable);
map.invalidate();
As the file is really heavy, the app is really slow.
How can I improve this, do I have to divide the map in Tiles?
Is there any idea/project that could help me?
Solution
You need to implement some sort of "lazyload" solution....now I havent worked with it much but this may be able to only load the parts of the image that the user is viewing instead of loading the whole thing at once. When the user moves then it will render the new area....I know you can do this with like an array of map markers...you may be able to use it to lazyload and image. Check this out: MapView Overlay Manager
You may be able to modify the lazyloading method to work for you...
Answered By - IZI_Shadow_IZI
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.