2
我想使用的NodeJS模塊:https://github.com/Esri/terraformer-arcgis-parserterraformer-arcgis-parser nodejs模塊有示例代碼錯誤?
從樣本文檔以下是我的直接代碼:
var ArcGIS = require('terraformer-arcgis-parser');
// parse ArcGIS JSON, convert it to a Terraformer.Primitive (GeoJSON)
var primitive = ArcGIS.parse({
x:"-122.6764",
y:"45.5165",
spatialReference: {
wkid: 4326
}
});
// take a Terraformer.Primitive or GeoJSON and convert it back to ArcGIS JSON
var point = ArcGIS.convert({
"type": "Point",
"coordinates": [45.5165, -122.6764]
});
我得到一個:
throw new Error("Unknown type: " + geojson.type);
Error: Unknown type: undefined
問題是什麼?看起來這應該不是一個問題...