How can I setup a click event for an individual Marker? I want to display a "custom" balloon when the Marker is clicked, the custom balloon is from another software program (DotNetBar).
bob
How can I setup a click event for an individual Marker? I want to display a "custom" balloon when the Marker is clicked, the custom balloon is from another software program (DotNetBar).
bob
Hi Bob,
You can set the click event when you declear it,
Marker marker = new Marker(new PointShape(0, 0));
marker.Image = your image
marker.Width = 20;
marker.Height = 34;
marker.YOffset = -17;
marker.Click += new EventHandler(marker_Click);
SimpleMarkerOverlay markerOverlay = new SimpleMarkerOverlay();
markerOverlay.Markers.Add(marker);
Hope it helps,
Edgar
Perfect. Thank you!!
bob
Hello Bob,
You are welcome, just feel free to let us know your problem.
Regards,
Gary
One more question for now on Markers. Can you set zoom levels with markers to make the marker bigger or smaller depending on Zoom Level? I noticed there doesn’t seem to be a zoomlevel property for the SimpleMarkerOverlay.
bob
Hello Bob,
Sorry for SimpleMarkerOverlay, you can’t change the marker image size through different zoomlevel, you can hook the map.extentchanged event and modify the image manual.
Or you can use InMemoryFeatureLayer, and set the pointshape simulate the marker, then you can set the InMemoryFeatureLayer’s zoomlevelset.zoomlevel01.defaultPointStyle to make the ‘marker’ image change with zoomlevle.
Regards,
Gary