Hi.
I am having a problem when I show a context menu.
The location of the context menu always is far from the marker.
Is there an atributte to manage the distance between the objects?
Regards,
Rafael.
Hi.
I am having a problem when I show a context menu.
The location of the context menu always is far from the marker.
Is there an atributte to manage the distance between the objects?
Regards,
Rafael.
Hello Rafael,
Thanks for your post, contextmenu of marker didn't have a property to control the offset, and I think in normal situation, i won't offset so much, please see the code below and have a try:
Map1.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.FromHtml("#E5E3DF"));
Map1.CurrentExtent = new RectangleShape(-131.22, 55.05, -54.03, 16.91);
Map1.MapUnit = GeographyUnit.DecimalDegree;
WorldMapKitWmsWebOverlay worldMapKitOverlay = new WorldMapKitWmsWebOverlay();
Map1.CustomOverlays.Add(worldMapKitOverlay);
SimpleMarkerOverlay markerOverlay = new SimpleMarkerOverlay();
Marker marker = new Marker(-118, 30);
marker.WebImage = new WebImage("../../theme/default/samplepic/circle.png");
ContextMenu menuOnMap = new ContextMenu("area", 180);
ContextMenuItem redirectItem = new ContextMenuItem("<a href='thinkgeo.com' target='_blank'>ThinkGeo<a>");
ContextMenuItem showPositionItem = new ContextMenuItem("CurrentPosition(Server Event)");
ContextMenuItem InfomationItem = new ContextMenuItem("<div onclick='popupInfomation();'>Infomation(Client Event)");
menuOnMap.MenuItems.Add(redirectItem);
menuOnMap.MenuItems.Add(showPositionItem);
menuOnMap.MenuItems.Add(InfomationItem);
marker.ContextMenu = menuOnMap;
markerOverlay.Markers.Add(marker);
Map1.CustomOverlays.Add(markerOverlay);
If you still can't let the context menu working, could you please provide a sample that can recreate the problem?
Regards,
Gary