Good day.
I have question.
I want draw marker and clicked context menu on the map.
My sample code is success draw marker on the map.
but, not working marker click event and don’t view context menu.
please check my code & problems.
Best regards.
— Index.cshtml —
@{ Html.ThinkGeo().Map(Model).Render(); }
— Controller —
ContextMenu menuOn = new ContextMenu(“test”, 180);
ContextMenuItem redirectItem = new ContextMenuItem(“test”);
menuOn.MenuItems.Add(redirectItem);
SimpleMarkerOverlay o = new SimpleMarkerOverlay();
Marker m = new Marker(128, 37);
m.WebImage = new WebImage("/Content/images/bcncar01.png");
m.WebImage.RotationAngle = 30;
m.Id = @“1”;
m.ContextMenu = menuOn;
o.Markers.Add(m);
m = new Marker(129, 38);
m.WebImage = new WebImage("/Content/images/bcncar01.png");
m.WebImage.RotationAngle = 270;
m.Id = @“2”;
m.ContextMenu = menuOn;
o.Markers.Add(m);
m.ContextMenu = menuOn;
__map.CustomOverlays.Add(o);