* @function SuperMap.Layer.MapVLayer.prototype.moveTo * @description 重置当前 MapV 图层的 div,再一次与 Map 控件保持一致。 * 修改当前显示范围,当平移或者缩放结束后开始重绘 MapV 图的渲染效果。 * @param {SuperMap.Bounds} bounds - 图层范围。 * @param {boolean} [zoomChanged] - 缩放级别是否改变。 * @param {boolean} [dragging] -
(bounds, zoomChanged, dragging)
| 185 | * @param {boolean} [dragging] - 是否拖动。 |
| 186 | */ |
| 187 | moveTo(bounds, zoomChanged, dragging) { |
| 188 | super.moveTo(bounds, zoomChanged, dragging); |
| 189 | if (!this.supported) { |
| 190 | return; |
| 191 | } |
| 192 | this.zoomChanged = zoomChanged; |
| 193 | if (!dragging) { |
| 194 | this.div.style.visibility = 'hidden'; |
| 195 | this.div.style.left = -parseInt(this.map.layerContainerDiv.style.left) + 'px'; |
| 196 | this.div.style.top = -parseInt(this.map.layerContainerDiv.style.top) + 'px'; |
| 197 | /*this.canvas.style.left = this.div.style.left; |
| 198 | this.canvas.style.top = this.div.style.top;*/ |
| 199 | var size = this.map.getSize(); |
| 200 | this.div.style.width = parseInt(size.w) + 'px'; |
| 201 | this.div.style.height = parseInt(size.h) + 'px'; |
| 202 | if (this.options.draw === 'heatmap') { |
| 203 | this.canvas.width = parseInt(size.w) * this.devicePixelRatio; |
| 204 | this.canvas.height = parseInt(size.h) * this.devicePixelRatio; |
| 205 | } else { |
| 206 | this.canvas.width = parseInt(size.w); |
| 207 | this.canvas.height = parseInt(size.h); |
| 208 | } |
| 209 | |
| 210 | this.canvas.style.width = this.div.style.width; |
| 211 | this.canvas.style.height = this.div.style.height; |
| 212 | this.maxWidth = size.w; |
| 213 | this.maxHeight = size.h; |
| 214 | this.div.style.visibility = ''; |
| 215 | if (!zoomChanged) { |
| 216 | this.renderer && this.renderer.render(); |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | if (zoomChanged) { |
| 221 | this.renderer && this.renderer.render(); |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | /** |
| 226 | * @function SuperMap.Layer.MapVLayer.prototype.transferToMapLatLng |
no test coverage detected