我不知道如何使用此库将坐标从utm转换为google lat lon。
我导入了这个:
<script src="javascript/lib/proj4js-combined.js"></script>
<script src="javascript/lib/defs/GOOGLE.js"></script>
<script src="javascript/lib/util/MGRS.js"></script>
现在我正在使用这个例子:
<script>
console.log("hola");
var utm = "+proj=utm +zone=32";
var wgs84 = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs";
console.log("prueba");
console.log(new Proj4js.Proj(utm,wgs84,[434306.32460000,4813243.12520000]));
</script>
我遇到了这个错误:
GET http://myurl/maps/javascript/lib/defs/+PROJ=UTM%20+ZONE=32.js 404 (Not Found) proj4js-combined.js:439
GET http://spatialreference.org/ref//+PROJ=UTM%20+ZONE=32/proj4js/ 404 (NOT FOUND) proj4js-combined.js:439
Uncaught TypeError: undefined is not a function proj4js-combined.js:743
我的错误在哪里?
答案 0 :(得分:0)
使用proj4(utm,wgs84,[434306.32460000,4813243.12520000])
代替