public static readonly string UniqueKey = "StationLayer"; public override Overlay GetOverlay(bool google) { FeatureSourceMarkerOverlay markerOverlay = new FeatureSourceMarkerOverlay(UniqueKey); MsSql2008FeatureSource source = new MsSql2008FeatureSource(System.Configuration.ConfigurationManager.ConnectionStrings["Location"].ConnectionString, "stationLayer", "oid"); source.Srid = 0; markerOverlay.FeatureSource = source; markerOverlay.SuppressingGridSize = 100; PropertyInfo zoomProperty = typeof(MarkerZoomLevelSet).GetProperty(String.Format("ZoomLevel{0:00}", 5)); MarkerZoomLevel zoomLevel = (MarkerZoomLevel)zoomProperty.GetValue(markerOverlay.ZoomLevelSet, null); switch (LayersManager.Settings.UserSetting.StationsFilter) { case "pps": zoomLevel.CustomMarkerStyle = GetValueStyle("pps", "True", GetStyle()); break; case "klm": zoomLevel.CustomMarkerStyle = GetValueStyle("klm", "True", GetStyle()); break; case "dium": zoomLevel.CustomMarkerStyle = GetValueStyle("dium", "True", GetStyle()); break; default: zoomLevel.CustomMarkerStyle = GetStyle(); break; } zoomLevel.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; MapControl.CustomOverlays.Add(markerOverlay); } private PointMarkerStyle GetStyle() { WebImage image = new WebImage(String.Format("Images/Marks/{0}.png", LayersManager.Settings.UserSetting.IconStation), 16, 16, 0f, -16f); PointMarkerStyle style = new PointMarkerStyle(); style.WebImage = image; style.Popup.ContentHtml = "