mirror of https://gitee.com/antv-l7/antv-l7
fix(util): geo convert
This commit is contained in:
parent
e9cb6a8eb5
commit
113aae900b
|
@ -1,7 +1,7 @@
|
|||
import Base from './base';
|
||||
import Controller from './controller/index';
|
||||
import { getTransform, getParser } from '../source';
|
||||
import { extent } from '../util/geo';
|
||||
import { extent, tranfrormCoord } from '../util/geo';
|
||||
import { getMap } from '../map/index';
|
||||
export default class Source extends Base {
|
||||
getDefaultCfg() {
|
||||
|
@ -47,7 +47,8 @@ export default class Source extends Base {
|
|||
}
|
||||
_projectCoords() {
|
||||
this.data.dataArray.forEach(data => {
|
||||
data.coordinates = this._coordProject(data.coordinates);
|
||||
// data.coordinates = this._coordProject(data.coordinates);
|
||||
data.coordinates = tranfrormCoord(data.coordinates, this._coorConvert.bind(this));
|
||||
});
|
||||
}
|
||||
createScale(field) {
|
||||
|
|
|
@ -57,7 +57,7 @@ export default class HeatMapLayer extends Layer {
|
|||
}
|
||||
|
||||
afterRender() {
|
||||
if (this.shapeType !== 'grid' || this.shapeType !== 'hexagon') {
|
||||
if (this.shapeType !== 'grid' && this.shapeType !== 'hexagon') {
|
||||
updateIntensityPass(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,3 +24,16 @@ function calcExtent(extent, coords) {
|
|||
}
|
||||
return extent;
|
||||
}
|
||||
|
||||
export function tranfrormCoord(data, cb) {
|
||||
return transform(data, cb);
|
||||
}
|
||||
function transform(item, cb) {
|
||||
if (Array.isArray(item[0])) {
|
||||
return item.map(coord => {
|
||||
return transform(coord, cb);
|
||||
});
|
||||
}
|
||||
return cb(item);
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue