Getting pixel coordinates of an image overlay using leaflet map library on click (right click)

后端 未结 4 1511
后悔当初
后悔当初 2020-12-17 17:18

I\'m trying to get the pixel coordinates of an image overlay on click (right click/contextmenu) using the leaflet map library. Essentially when a user clicks on the image, I

4条回答
  •  無奈伤痛
    2020-12-17 17:34

    I don't know about leaflet but you dont need it to achieve this. With javascript you can implement a listener and use event.latLng in a marker to manipulate the info.

    google.maps.event.addListener(map, 'click', function(event) {
        marker.setPosition(event.latLng);   
    });
    

    Check this working fiddle

提交回复
热议问题