您只需使用距离公式,即sqrt((x2-x1)**2 + (y2 - 21)**2)
Google地图中心坐标为0, 0
右上角为200, 200
您提供的图片位于左上角为-200, -200
。
Google为您提供了一种导出地图文件的方法,因此您可以根据需要从中提取确切位置
您可以使用]来使边界变色(可见地图的坐标)>
bounds = map.getBounds();
一旦有了边界,就可以提取所需的坐标
ne = bounds.getNorthEast(); sw = bounds.getSouthWest();
关于距离,您可以使用Google地图中的几何库和computeDistanceBetween()函数
google.maps.geometry.spherical.computeDistanceBetween (latLngA, latLngB);