I am attempting to change the WebImage of a Marker added to our map's InMemoryMarkerOverlay in the MarkerOverlay_Click event. In the Click event I have the following code:
protected void markerOverlay_Click(object sender, MarkerOverlayClickEventArgs e)
{
int times;
if (ViewState["ClickTimes" + e.FeatureId] != null)
{
times = (int)ViewState["ClickTimes" + e.FeatureId];
times++;
}
else
{
times = 1;
}
ViewState["ClickTimes" + e.FeatureId] = times;
InMemoryMarkerOverlay markerOverlay = (InMemoryMarkerOverlay)frMap.CustomOverlays["MarkerOverlay"];
if (times % 2 > 0)
{
markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.WebImage.ImageVirtualPath = Page.ResolveUrl("~/MapSuiteData/theme/default/img/marker_blue.png");
}
else
{
markerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.WebImage.ImageVirtualPath = Page.ResolveUrl("~/MapSuiteData/theme/default/img/marker_yellow.png");
}
}
I would like to be able to click on a marker and only it's WebImage gets updated, not all markers on the map, which is the current result. The effect I am looking for is that this marker can have a "selected" and "deselected" look. Any help would be appreciated.
Thanks!