/// <summary> /// Handler for zoom level change. /// This handler will deal with overlays visibility, change MARKERS images according to zoom level. /// </summary> /// <param name="gmap">Map control</param> public static void OnMapZoomChanged(GMapControl gmap) { gmap.HoldInvalidation = true; int iz = GMapMarkerImages.ReturnImageLevelFromZoom(gmap.Zoom); GMapOverlay overlay = gmap.Overlays[GMapWrapper.MARKERS]; foreach (GMapMarker m in overlay.Markers) { GMapMarkerImages.ChangeImageAccordingToZoom((GMapMarkerImages)m, iz); } gmap.Refresh(); // on désactive pour les zoom très éloignés certains overlay GMapWrapper.HandleOverlaysVisibility(gmap, iz, gmap.Zoom); }
/// <summary> /// Hide overlays of a map control if needed. /// Some overlays will be hiden for low zoom levels /// Zoom level will be automatically retrieved from map control /// </summary> /// <param name="gmap">Map control</param> public static void HandleOverlaysVisibility(GMapControl gmap) { int iz = GMapMarkerImages.ReturnImageLevelFromZoom(gmap.Zoom); GMapWrapper.HandleOverlaysVisibility(gmap, iz, gmap.Zoom); }