Exposed _shadow property in Leaflet.Marker class (#42788)

This commit is contained in:
kygoh
2020-03-12 15:26:39 -07:00
committed by GitHub
parent 268797f925
commit 047b43c848
2 changed files with 12 additions and 0 deletions
+2
View File
@@ -1906,6 +1906,8 @@ export class Marker<P = any> extends Layer {
options: MarkerOptions;
dragging?: Handler;
feature?: geojson.Feature<geojson.Point, P>;
protected _shadow: HTMLElement | undefined;
}
export function marker(latlng: LatLngExpression, options?: MarkerOptions): Marker;
+10
View File
@@ -502,6 +502,16 @@ class MyMarker extends L.Marker {
constructor() {
super([12, 13]);
}
// adapted from Leaflet.AnimatedMarker
animate() {
const speed = 1000;
if (L.DomUtil.TRANSITION) {
if (this.getElement()) { this.getElement().style.setProperty(L.DomUtil.TRANSITION, `all ${speed}ms linear`); }
if (this._shadow) { this._shadow.style.setProperty(L.DomUtil.TRANSITION, `all ${speed}ms linear`); }
}
}
}
class MyLayer extends L.Layer {