Javascript 在传单上获取坐标的方法
我有一个按钮来显示一个文本,其中包含边界中心的坐标。如上所示的示例 但它只适用于getCenter,如果我改为GetSouthwest或边界的任何一个角,它都不起作用。 我错过了什么?Javascript 在传单上获取坐标的方法,javascript,leaflet,coordinates,latitude-longitude,Javascript,Leaflet,Coordinates,Latitude Longitude,我有一个按钮来显示一个文本,其中包含边界中心的坐标。如上所示的示例 但它只适用于getCenter,如果我改为GetSouthwest或边界的任何一个角,它都不起作用。 我错过了什么? 根据这个例子,它是一样的。好的,我需要添加getBounds,这样 L.easyButton('fa-crosshairs fa-lg', function(btn, map){ alert('coordinates:'map.getBounds.getSouthEast().toString()) }).add
根据这个例子,它是一样的。好的,我需要添加getBounds,这样
L.easyButton('fa-crosshairs fa-lg', function(btn, map){
alert('coordinates:'map.getBounds.getSouthEast().toString())
}).addTo(Map);
错误是什么?它没有返回任何内容,也没有打开警报框。
L.easyButton('fa-crosshairs fa-lg', function(btn, map){
alert('coordinates:'map.getBounds.getSouthEast().toString())
}).addTo(Map);