How do I get a different marker image based on a column value?
How can I retrieve a dbf column value, from a marker on the client side in a featuresource marker overlay?
How do I get a different marker image based on a column value?
How can I retrieve a dbf column value, from a marker on the client side in a featuresource marker overlay?
Hello Eric,
Thanks for your post, for your first question, we have MarkerValueStyle, below is some sample code that I hope can help you:
ValueMarkerStyle a = new ValueMarkerStyle("POP2000");
a.ValueItems.Add(new MarkerValueItem("554636", new PointMarkerStyle(new WebImage("../../theme/default/samplepic/circle.png"))));
markerOverlay.FeatureSource = new ShapeFileFeatureSource(MapPath("~/SampleData/USA/cities_a.shp"));
markerOverlay.ZoomLevelSet.ZoomLevel01.CustomMarkerStyle = a;
markerOverlay.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
And for your second question, sorry dbf column is a property related to featureSource, and in openlayer ,there isn't such function or property to change/get it, you have to use Ajax, get the marker Id with openlayer, then call server side, get the dbf column value in serverside and callback to client side.
Please feel free to let us know if you have queries.
Regards,
Gary
Thank you, this me told exactly what I needed to know.
Hello Eric,
You are welcome, please don’t hesitate to let us know your questions.
Regards,
Gary