Gmap.Net Marker at incorrect position but when the map is zoomed the marker goes to right place

后端 未结 2 1919
梦如初夏
梦如初夏 2021-01-18 07:15

I\'ve a Windows Forms Application with a Gmap.Net controller, what I want to do is to add markers based on an outside sources that provides

相关标签:
2条回答
  • 2021-01-18 07:43

    It's because you're adding the marker to the overlay that has not been added to the map's overlays. Try to switch the order of the statements as follows:

    gmap.Overlays.Add(markersOverlay);
    markersOverlay.Markers.Add(marker);
    
    0 讨论(0)
  • 2021-01-18 07:48

    add a first marker at lat,lon = 0,0. you can also make this marker invisible with setting its marker image as 1x1 pixel transparent png image. first element of the marker do this kind of wrong placement.

    0 讨论(0)
提交回复
热议问题