Hi,
What is the best way to create markers from shape file and use our own icons for markers?
I've tried 2 ways: (1)FeatureSourceMarker Overlay, (2)ShapeFileFeatureLayer.
In the first way, I could use our own icons, but performance is very bad. It take about 7 sec to show all markers (~3000) on the map. Why it is so long? Does it upload the same icon for each marker and generate image on the server?
In the secon way, performance is good, but I have to use your standard shapes and didn't find way how to apply our own icons.
Below is my code:
FeatureSourceMarkerOverlay producerOverlay = new FeatureSourceMarkerOverlay("ProducerMarkers");
producerOverlay.FeatureSource = new ShapeFileFeatureSource(Server.MapPath("~/App_Data/SHP/Properties/Producer.shp"));
producerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.WebImage = new WebImage("/Icons/Producer.png");
producerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.ContentHtml = "[#PropertyNa#]";
producerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.AutoSize = true;
producerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.BackgroundColor = GeoColor.StandardColors.White;
producerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.BorderColor = GeoColor.StandardColors.Black;
producerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.BorderWidth = 1;
producerOverlay.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
---------------
ShapeFileFeatureLayer producerLabelLayer = new ShapeFileFeatureLayer(Server.MapPath("~/App_Data/SHP/Properties/Producer.shp"));
producerLabelLayer.Name = "ProducerLabel";
producerLabelLayer.ZoomLevelSet.ZoomLevel06.DefaultTextStyle = TextStyles.CreateSimpleTextStyle("PropertyNa", "Arial", 8, DrawingFontStyles.Italic, GeoColor.StandardColors.Brown, 3, 3);
producerLabelLayer.ZoomLevelSet.ZoomLevel06.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
producerLabelLayer.DrawingMarginPercentage = 50;