fix: 修复高德2 动态点位引发的 bug (#1130)

This commit is contained in:
YiQianYao 2022-05-30 22:47:52 +08:00 committed by GitHub
parent abe00491ad
commit e10aa5aac8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 15 deletions

View File

@ -216,11 +216,11 @@ export default class DataMappingPlugin implements ILayerPlugin {
// @ts-ignore
d.originCoordinates = cloneDeep(d.coordinates); // 为了兼容高德1.x 需要保存一份原始的经纬度坐标数据(许多上层逻辑依赖经纬度数据)
// @ts-ignore
// d.coordinates = this.mapService.lngLatToCoord(d.coordinates);
d.coordinates = this.mapService.lngLatToCoordByLayer(
d.coordinates,
layerCenter,
);
d.coordinates = this.mapService.lngLatToCoord(d.coordinates);
// d.coordinates = this.mapService.lngLatToCoordByLayer(
// d.coordinates,
// layerCenter,
// );
});
} else {
// 连续的线、面数据
@ -233,11 +233,11 @@ export default class DataMappingPlugin implements ILayerPlugin {
// @ts-ignore
d.originCoordinates = cloneDeep(d.coordinates); // 为了兼容高德1.x 需要保存一份原始的经纬度坐标数据(许多上层逻辑依赖经纬度数据)
// @ts-ignore
// d.coordinates = this.mapService.lngLatToCoords(d.coordinates);
d.coordinates = this.mapService.lngLatToCoordsByLayer(
d.coordinates,
layerCenter,
);
d.coordinates = this.mapService.lngLatToCoords(d.coordinates);
// d.coordinates = this.mapService.lngLatToCoordsByLayer(
// d.coordinates,
// layerCenter,
// );
});
}
}

View File

@ -44,11 +44,11 @@ export default class ShaderUniformPlugin implements ILayerPlugin {
this.coordinateSystemService.refresh();
if (version === 'GAODE2.x') {
const layerCenter = this.getLayerCenter(layer);
// @ts-ignore
this.mapService.map.customCoords.setCenter(layerCenter);
// @ts-ignore
this.mapService.setCustomCoordCenter(layerCenter);
// const layerCenter = this.getLayerCenter(layer);
// // @ts-ignore
// this.mapService.map.customCoords.setCenter(layerCenter);
// // @ts-ignore
// this.mapService.setCustomCoordCenter(layerCenter);
// @ts-ignore
mvp = this.mapService.map.customCoords.getMVPMatrix();
// mvp = amapCustomCoords.getMVPMatrix()