Hello,
I am currently in the process of converting our app from MapSuite Web Forms edition to MVC and I want to move some of the logic from javascript server-side. Previously, we have been creating the feature layer using OpenLayers vector layer and GML format. I am now instead using InMemoryMarkerOverlay.
One of the things I need to accompish is this:
- Each marker should be rendered with (1) a specific image AND (2) rotation based on column values in the feature. I am using ValueMarkerStyle with a "color" column name to accomplish (1), however, based on another column value "angle" I need to apply a rotation to the WebImage. With OpenLayers I was able to do this using a style map to set the correct image based on the value of "color", and access the "angle" column value of the feature using the special syntax "${angle}".
How can I accomplish the same server-side? This post shows something similar:
gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/12/aft/9565/afv/topic/Default.aspx
I tried something like the following but it is not working:
var markerStyle = new ValueMarkerStyle("color");
var image = new WebImage("red_image.png");
image.RotationAngle = float.Parse("[#angle#]");
markerStyle.ValueItems.Add(new MarkerValueItem("red", new PointMarkerStyle(image)));
- Secondly, I am contemplating whether to use InMemoryMarkerOverlay or InMemoryFeatureLayer. For some reason I am seeing slightly better performance (less lag when panning/zooming) with the InMemoryFeatureLayer with about 900 features, however, I am uncertain whether it will support my requirements to use marker popups and feature selection? I would like your advise on this. Also, when I use the InMemoryFeatureLayer there is some rendering issue with the features. When I pan the map the visible markers "flicker" on the screen until they move to the new positions.
- Lastly, how do I change the mouse cursor into a hand/pointer when someone mouse over a feature/marker? Again, I was able to set this with the OpenLayers style map.
I hope you can help. If there is some way to accomplish the above by "applying" the style client side, while still managing features/layer on the server I suppose that would be okay too.
Thank you,
Sindre