GMap.Net缩放问题鼠标悬停/悬停标记

时间:2016-01-18 01:43:18

标签: c# .net winforms gmap.net

当光标位于标记上方时,它不会缩放。有没有办法解决这个问题?

干杯

public MainForm(Dictionary<string, string> startupParams)
{
    InitializeComponent();
    gMapControl.MapProvider = GMapProviders.GoogleMap;
    gMapControl.Position = new PointLatLng(-33.861468, 151.209179);
    gMapControl.MinZoom = 0;
    gMapControl.MaxZoom = 24;
    gMapControl.Zoom = 9;
    gMapControl.MarkersEnabled = true;
    gMapControl.DragButton = MouseButtons.Left;
    gMapControl.ShowCenter = false;
}

private void UpdateMap()
{
    gMapControl.Position = new PointLatLng(Convert.ToDouble(LatLng.Split(',')[0]), Convert.ToDouble(LatLng.Split(',')[1]));
    GMapOverlay markersOverlay = new GMapOverlay("markers");
    GMarkerGoogle marker = new GMarkerGoogle(new PointLatLng(Convert.ToDouble(LatLng.Split(',')[0]), Convert.ToDouble(LatLng.Split(',')[1])), GMarkerGoogleType.green);
    markersOverlay.Markers.Add(marker);
    gMapControl.Overlays.Clear();
    gMapControl.Overlays.Add(markersOverlay);
}

1 个答案:

答案 0 :(得分:4)

是的,有一个简单的方法:

class MenuItemViewset(viewsets.ModelViewSet):
    serializer_class = MainMenuSerializer

    def retrieve(self, request, pk=None):
        return Restaurant.objects.get(pk=pk).menumain_set.all()[0].menumainitems_set.all()