MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / write

Method write

src/common/format/WKT.js:308–332  ·  view source on GitHub ↗

* @function WKTFormat.prototype.write * @description 将矢量要素或矢量要素数组序列化为 WKT 字符串。 * @param {(FeatureVector|Array)} features - 矢量要素或矢量要素数组。 * @returns {string} 表示几何的 WKT 字符串。

(features)

Source from the content-addressed store, hash-verified

306 * @returns {string} 表示几何的 WKT 字符串。
307 */
308 write(features) {
309 var collection, geometry, isCollection;
310 if (features.constructor === Array) {
311 collection = features;
312 isCollection = true;
313 } else {
314 collection = [features];
315 isCollection = false;
316 }
317 var pieces = [];
318 if (isCollection) {
319 pieces.push('GEOMETRYCOLLECTION(');
320 }
321 for (var i = 0, len = collection.length; i < len; ++i) {
322 if (isCollection && i > 0) {
323 pieces.push(',');
324 }
325 geometry = collection[i].geometry;
326 pieces.push(this.extractGeometry(geometry));
327 }
328 if (isCollection) {
329 pieces.push(')');
330 }
331 return pieces.join('');
332 }
333
334 /**
335 * @function WKTFormat.prototype.extractGeometry

Callers 13

JSONSpec.jsFile · 0.45
WKTSpec.jsFile · 0.45
crFunction · 0.45
echarts-en.min.jsFile · 0.45
echarts.min.jsFile · 0.45
ol.jsFile · 0.45
iconfont.jsFile · 0.45
loadPreviewFunction · 0.45
iconfont.jsFile · 0.45

Calls 2

extractGeometryMethod · 0.95
pushMethod · 0.80

Tested by

no test coverage detected