(units, originX, originY, centerX, centerY, width, height)
| 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]; |
no test coverage detected