mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-12 13:28:36 +03:00
Minimal cosmetic change
This commit is contained in:
@@ -77,22 +77,14 @@ class Map extends React.Component {
|
||||
|
||||
map.keyboard.disable();
|
||||
|
||||
map.on("move", () => this.alignLayers());
|
||||
map.on("zoomend viewreset moveend", () => this.alignLayers());
|
||||
map.on('move zoomend viewreset moveend', () => this.alignLayers());
|
||||
map.on('zoomstart', () => { if (this.svgRef.current !== null) this.svgRef.current.classList.add('hide') });
|
||||
map.on('zoomend', () => { if (this.svgRef.current !== null) this.svgRef.current.classList.remove('hide'); });
|
||||
|
||||
this.addResizeListener();
|
||||
window.addEventListener('resize', () => { this.alignLayers(); });
|
||||
|
||||
this.map = map;
|
||||
}
|
||||
|
||||
addResizeListener() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.alignLayers();
|
||||
});
|
||||
}
|
||||
|
||||
alignLayers() {
|
||||
const mapNode = document.querySelector('.leaflet-map-pane');
|
||||
if (mapNode === null) return { transformX: 0, transformY: 0 };
|
||||
|
||||
Reference in New Issue
Block a user