纬度/经度坐标在amMap美国地图中不正确 [英] Latitude/Longitude coordinates are not correct in amMap USA map
问题描述
我正在使用usaLow.js地图构建地图.在地图初始化上,我调用返回此数据的json方法:
I am building a map using the usaLow.js map. On map init, I call a json method that returns this data:
[{latitude: "40.4258686",longitude: "-86.9080655"}]
使用此数据,我将使用以下数据添加到地图的数据提供程序(mapData):
With this data I add to the map's data provider (mapData) with this:
mapData.images = [];
for(var i = 0; i < resp.length; ++i){
mapData.images.push({
type: "circle",
color:"#FF0000",
latitude: parseFloat(resp[i].latitude),
longitude: parseFloat(resp[i].longitude)
});
}
map.validateData();
此位置应位于印第安纳州,但这是我看到标记的位置:
This location should be in Indiana, but this is where I see the marker:
不使用世界地图时,是否需要转换纬度/经度坐标?如果是这样,那该怎么办?
Do lat/long coordinates need to be converted when not using world maps? If so, how can that be done?
修复了JSON字符串错字
推荐答案
似乎您使用的是未经校准的美国地图. (usaLow.js)该地图出于视觉目的而变形,因此与真实的纬度/经度坐标不兼容.
It seems like you are using a non-calibrated US map. (usaLow.js) This map is distorted for visual purposes and thus not compatible with real latitude/longitude coordinates.
要解决此问题,您将需要使用已校准的其中一张地图.这些选项是:
To work around that, you will need to use one of the maps that are calibrated. The options are these:
它已针对美国本土进行了Mercator校准.标记应标出OK(除了阿拉斯加和夏威夷),该区域已被置换.
It is Mercator-calibrated for mainland US. The markers should plot OK, except for Alaska and Hawaii, that area displaced.
此地图与阿拉斯加和夏威夷等坐标完全兼容.但是,它可能看起来不那么吸引人:
This map is fully compatible with coordinates, including Alaska and Hawaii. However, it might not look as appealing:
这两个地图都与JavaScript地图捆绑在一起.
Both of those maps are bundled with JavaScript Maps.
这篇关于纬度/经度坐标在amMap美国地图中不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!