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

Method getLocalXY

src/mapboxgl/overlay/theme/ThemeLayer.js:418–429  ·  view source on GitHub ↗

* @function ThemeLayer.prototype.getLocalXY * @description 地理坐标转为像素坐标。 * @param {Object} [coordinate] - 坐标位置。 * @returns {Array} 长度为 2 的像素坐标数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。

(coordinate)

Source from the content-addressed store, hash-verified

416 * @returns {Array} 长度为 2 的像素坐标数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
417 */
418 getLocalXY(coordinate) {
419 var pixelP, map = this.map;
420 if (coordinate instanceof Point || coordinate instanceof GeoText) {
421 let tempPoint = map.project(new mapboxgl.LngLat(coordinate.x, coordinate.y));
422 pixelP = [tempPoint.x, tempPoint.y];
423 }
424 if (coordinate instanceof LonLat) {
425 let tempPoint = map.project(new mapboxgl.LngLat(coordinate.lon, coordinate.lat));
426 pixelP = [tempPoint.x, tempPoint.y];
427 }
428 return pixelP;
429 }
430
431 /**
432 * @function ThemeLayer.prototype.toiClientFeature

Callers 1

getLabelInfoMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected