Minimal cosmetic change

This commit is contained in:
Franc Camps-Febrer
2018-12-19 15:59:31 +01:00
parent 775608edf4
commit f6997765d6

View File

@@ -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 };