diff --git a/src/core/engine/index.js b/src/core/engine/index.js index 8d6fee67c6..b9534cc75a 100644 --- a/src/core/engine/index.js +++ b/src/core/engine/index.js @@ -28,9 +28,9 @@ export default class Engine extends EventEmitter { } run() { - - this.update(); - this.engineID = requestAnimationFrame(this.run.bind(this)); + + this.update(); + this.engineID = requestAnimationFrame(this.run.bind(this)); } stop() { cancelAnimationFrame(this.engineID); diff --git a/src/geo/project.js b/src/geo/project.js index db3372da57..c4f57b99fe 100644 --- a/src/geo/project.js +++ b/src/geo/project.js @@ -15,18 +15,3 @@ export function aProjectFlat(lnglat) { y = scale * (c * y + d) - 106744817; return { x, y }; } -export function world2LngLat(x, y) { - const scale = 256 << 20; - let d = Math.PI / 180; - const a = 0.5 / Math.PI, - b = 0.5, - c = -0.5 / Math.PI; - d = 0.5; - x = ((x + 215440491) / scale - b) / a; - y = ((y + 106744817) / scale - d) / c; - y = (Math.atan(Math.pow(Math.E,y)) - (Math.PI / 4)) *2; - const lat = y /d; - const lng = x / d; - return [lng,lat]; -} - diff --git a/src/map/gaodeMap.js b/src/map/gaodeMap.js index 161df53f16..70f9dd8829 100644 --- a/src/map/gaodeMap.js +++ b/src/map/gaodeMap.js @@ -55,7 +55,7 @@ export default class GaodeMap { } containerToLngLat(pixel) { - const ll = new AMap.Pixel(pixel.x,pixel.y); + const ll = new AMap.Pixel(pixel.x, pixel.y); return this.map.containerToLngLat(ll); } setMapStyle(style) {