MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / fromGeoJSON

Method fromGeoJSON

src/common/format/GeoJSON.js:534–542  ·  view source on GitHub ↗

* @function GeoJSONFormat.prototype.fromGeoJSON * @version 9.1.1 * @description 将 GeoJSON 对象或者 GeoJSON 对象字符串转换为 SuperMap iServer Feature JSON。 * @param {GeoJSONObject} json - GeoJSON 对象。 * @param {string} [type='FeaureCollection'] - 可选的字符串,它决定了输出的格式。支持的值有:"Geometry","Feature",和 "

(json, type, filter)

Source from the content-addressed store, hash-verified

532 * @returns {Object} SuperMap iServer Feature JSON。
533 */
534 fromGeoJSON(json, type, filter) {
535 let feature = this.read(json, type, filter);
536 if (!Util.isArray(feature)) {
537 return this._toiSevrerFeature(feature);
538 }
539 return feature.map((element) => {
540 return this._toiSevrerFeature(element);
541 })
542 }
543
544 /**
545 * @function GeoJSONFormat.prototype.toGeoJSON

Callers 1

GeoJSONSpec.jsFile · 0.80

Calls 3

readMethod · 0.95
_toiSevrerFeatureMethod · 0.95
mapMethod · 0.80

Tested by

no test coverage detected