0

i want set the visibility to itemized overlay in map view. if the zoom level is less than 10 i want to set visibility of overlay is GONE else VISIBLE. how to do that? and also cant set zoom level Listener.

Praveen
  • 90,477
  • 74
  • 177
  • 219

2 Answers2

2

i want set the visibility to itemized overlay in map view. if the zoom level is less than 10 i want to set visibility of overlay is GONE else VISIBLE.

Overlays do not have a visibility. If you do not want the overlay to appear, remove it from the MapView's list of overlays.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
0

Create a new class based on ItemizedOverlay, add a field to like `m_isVisible' and override the draw function like;

@Override
public void draw(Canvas canvas, MapView mapView, boolean shadow) {
    if(m_isVisible){
        super.draw(canvas, mapView, shadow);
    }
}
BreinBaas
  • 391
  • 3
  • 11