fix(pick):mousemove

This commit is contained in:
李正学 2018-10-31 18:02:59 +08:00
parent 6fc36a6ec6
commit 6d36ba8aa7
3 changed files with 4 additions and 19 deletions

View File

@ -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);

View File

@ -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];
}

View File

@ -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) {