Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/412.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在传单上获取坐标的方法_Javascript_Leaflet_Coordinates_Latitude Longitude - Fatal编程技术网

Javascript 在传单上获取坐标的方法

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

我有一个按钮来显示一个文本,其中包含边界中心的坐标。如上所示的示例

但它只适用于getCenter,如果我改为GetSouthwest或边界的任何一个角,它都不起作用。 我错过了什么?
根据这个例子,它是一样的。

好的,我需要添加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);