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

Method updateTransform

src/common/util/MapExtend.js:109–144  ·  view source on GitHub ↗
(units, originX, originY, centerX, centerY, width, height)

Source from the content-addressed store, hash-verified

107 }
108
109 updateTransform(units, originX, originY, centerX, centerY, width, height) {
110 this.transform.units = units;
111 const mercatorZfromAltitude = this.mercatorZfromAltitude;
112 product.MercatorCoordinate.fromLngLat = function (lngLatLike, altitude) {
113 altitude = altitude || 0;
114 const lngLat = product.LngLat.convert(lngLatLike);
115 return new product.MercatorCoordinate(
116 (lngLat.lng - originX) / width,
117 (originY - lngLat.lat) / height,
118 mercatorZfromAltitude(altitude, lngLat.lat)
119 );
120 };
121 product.MercatorCoordinate.prototype.toLngLat = function () {
122 return new product.LngLat(this.x * width + originX, originY - this.y * height);
123 };
124 this.customConvertPoint = window.URL.createObjectURL(
125 new Blob(
126 [
127 'customConvertPoint = {projectX:function(x){return (x - ' +
128 centerX +
129 ') / ' +
130 width +
131 ' + 0.5},projectY:function(y){y = 0.5 - ((y - ' +
132 centerY +
133 ') / ' +
134 height +
135 ');return y < 0 ? 0 : y > 1 ? 1 : y;},toY:function(y){return (0.5-y)*' +
136 height +
137 '+' +
138 centerY +
139 ';}}'
140 ],
141 { type: 'text/javascript' }
142 )
143 );
144 }
145
146 getPaintProperty(layerId, name) {
147 const overlayLayer = this.overlayLayersManager[layerId];

Callers 15

pgFunction · 0.45
OmFunction · 0.45
pgFunction · 0.45
AxisBuilderFunction · 0.45
buildAxisLabelFunction · 0.45
OmFunction · 0.45

Calls 1

convertMethod · 0.80

Tested by

no test coverage detected