mirror of https://gitee.com/antv-l7/antv-l7
fix: 高德地图新
This commit is contained in:
parent
bb1f0b224d
commit
73c15918ed
|
@ -274,6 +274,10 @@ export default class Marker extends EventEmitter {
|
|||
element.appendChild(svg);
|
||||
}
|
||||
DOM.addClass(element, 'l7-marker');
|
||||
Object.keys(this.markerOption.style || {}).forEach((key: string) => {
|
||||
// @ts-ignore
|
||||
element?.style[key] = this.markerOption?.style[key];
|
||||
});
|
||||
element.addEventListener('click', (e: MouseEvent) => {
|
||||
this.onMapClick(e);
|
||||
});
|
||||
|
|
|
@ -17,6 +17,7 @@ export interface IMarkerOption {
|
|||
offsets: number[];
|
||||
draggable: boolean;
|
||||
extData?: any;
|
||||
style?: CSSStyleDeclaration;
|
||||
}
|
||||
export interface IMarker {
|
||||
addTo(scene: Container): void;
|
||||
|
|
|
@ -148,6 +148,8 @@ export interface IMapConfig<RawMap = {}> {
|
|||
|
||||
attributionControl?: boolean;
|
||||
|
||||
offsetCoordinate?: boolean;
|
||||
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
|
|
|
@ -311,6 +311,7 @@ export default class L7MapService implements IMapService<Map> {
|
|||
|
||||
private handleCameraChanged = () => {
|
||||
const { lat, lng } = this.map.getCenter();
|
||||
const { offsetCoordinate = false } = this.config;
|
||||
|
||||
// resync
|
||||
this.viewport.syncWithMapCamera({
|
||||
|
@ -324,7 +325,10 @@ export default class L7MapService implements IMapService<Map> {
|
|||
cameraHeight: 0,
|
||||
});
|
||||
// set coordinate system
|
||||
if (this.viewport.getZoom() > LNGLAT_OFFSET_ZOOM_THRESHOLD) {
|
||||
if (
|
||||
this.viewport.getZoom() > LNGLAT_OFFSET_ZOOM_THRESHOLD &&
|
||||
offsetCoordinate
|
||||
) {
|
||||
this.coordinateSystemService.setCoordinateSystem(
|
||||
CoordinateSystem.LNGLAT_OFFSET,
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue