Reputation: 171
how can i add different overlays at different zoom levels ? For instance i have an overlay image of a festival area that ive added onto the map which is great. But when the user zooms out i want to change the image that the user see's .Does anyone know how to do this?
Upvotes: 1
Views: 1240
Reputation: 11
I was having same problem but what you can do is define the size of bitmap based on difference of two geopoints e.g.
GeoPoint PointC = new GeoPoint((int)(35.496392 * 1E6), (int)(-97.5375950 * 1E6));
GeoPoint PointR = new GeoPoint((int)(35.496392 * 1E6), (int)(-97.5362690 * 1E6));
GeoPoint PointH = new GeoPoint((int)(35.696392 * 1E6), (int)(-97.5362690 * 1E6));
Point poC = new Point();
Point poR = new Point();
Point poH = new Point();
projection.toPixels(ovalR, poR);
projection.toPixels(ovalC, poC);
projection.toPixels(ovalH, poH);
cWidth = Math.abs(poC.x-poR.x);
cHieght = Math.abs(poC.y-poH.y);
Bitmap bitmap= Bitmap.createScaledBitmap(mBitmap, cWidth, cHeight, true);
Upvotes: 1
Reputation: 382434
If you control the zoom buttons (by having your own buttons), you may simply change the displayed overlays by modifying the array mapView.getOverlays() and then call mapView.invalidate().
I didn't try to change it so frequently but it should probably work.
Upvotes: 0
Reputation: 25058
The only thing that I can think of is to pass the zoom level into the overlay when it changes in the map and then make the decision on what to draw in the overlay.
Upvotes: 2