From aee146ba629328de9cb6624abd425ad145846632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Vigh?= Date: Sat, 1 May 2021 20:28:44 +0200 Subject: [PATCH] removed unused css declarations; renamed invalidateSize to resize --- public/static/css/map_editor.css | 5 ----- public/static/js/map_editor.js | 34 +++++++++++++++----------------- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/public/static/css/map_editor.css b/public/static/css/map_editor.css index 3336e50..1b46865 100644 --- a/public/static/css/map_editor.css +++ b/public/static/css/map_editor.css @@ -12,11 +12,6 @@ width: 1em; height: 1em; vertical-align: -0.15em; - fill: #ffffff; -} - -#mapSelection img svg { - fill: #28a745; } /* modify the cursor for the Leaflet map */ diff --git a/public/static/js/map_editor.js b/public/static/js/map_editor.js index 255f73f..3ff1659 100644 --- a/public/static/js/map_editor.js +++ b/public/static/js/map_editor.js @@ -117,7 +117,7 @@ MapEditor.resetSelected(); MapEditor.selectedMarker = marker; - MapEditor.map.invalidateSize(true); + MapEditor.map.resize(); MapEditor.map.panTo(marker.getLatLng()); MapEditor.panorama.setVisible(false); @@ -219,7 +219,7 @@ MapEditor.resetSelected(del); MapEditor.selectedMarker = null; - MapEditor.map.invalidateSize(true); + MapEditor.map.resize(); }, deletePlace: function () { @@ -373,7 +373,7 @@ init: function (divId, places) { document.getElementById(divId).style.display = "block"; - if(!LMapWrapper.map) { + if (!LMapWrapper.map) { LMapWrapper.divId = divId; LMapWrapper.map = L.map(LMapWrapper.divId, { zoomControl: false @@ -401,12 +401,12 @@ LMapWrapper.loadMarkers(places); }, - hide: function() { + hide: function () { document.getElementById(LMapWrapper.divId).style.display = 'none'; }, loadMarkers: function (places) { - if(!LMapWrapper.markers) { + if (!LMapWrapper.markers) { LMapWrapper.markers = L.markerClusterGroup({ maxClusterRadius: 50 }); @@ -455,8 +455,8 @@ LMapWrapper.map.panTo(latLng); }, - invalidateSize: function (invalid) { - LMapWrapper.map.invalidateSize(invalid); + resize: function () { + LMapWrapper.map.invalidateSize(true); }, changeMarkerIcon: function (marker, icon) { @@ -497,7 +497,7 @@ init: function (divId, places) { document.getElementById(divId).style.display = "block"; - if(!GMapWrapper.map) { + if (!GMapWrapper.map) { GMapWrapper.divId = divId; GMapWrapper.map = new google.maps.Map(document.getElementById(GMapWrapper.divId), { center: { lat: 0., lng: 0. }, @@ -528,12 +528,12 @@ GMapWrapper.loaded = true; }, - hide: function() { + hide: function () { document.getElementById(GMapWrapper.divId).style.display = 'none'; }, loadMarkers: function (places) { - if(!GMapWrapper.markers) { + if (!GMapWrapper.markers) { GMapWrapper.markers = new MarkerClusterer(GMapWrapper.map, [], { imagePath: STATIC_ROOT + '/img/markers/m', imageExtension: 'png?rev' + REVISION @@ -541,7 +541,7 @@ } else { GMapWrapper.markers.clearMarkers(); } - + for (var placeId in places) { if (!places.hasOwnProperty(placeId)) { continue; @@ -595,10 +595,8 @@ GMapWrapper.map.panTo(latLng); }, - invalidateSize: function (invalid) { - if (invalid) { - google.maps.event.trigger(GMapWrapper.map, 'resize'); - } + resize: function () { + google.maps.event.trigger(GMapWrapper.map, 'resize'); }, changeMarkerIcon: function (marker, icon) { @@ -682,11 +680,11 @@ } }; - document.getElementById('mapSelector').onclick = function() { + document.getElementById('mapSelector').onclick = function () { MapEditor.closePlace(); MapEditor.map.hide(); - if(MapEditor.map === GMapWrapper) { + if (MapEditor.map === GMapWrapper) { MapEditor.map = LMapWrapper; MapEditor.map.init('lmap', places); } else { @@ -694,7 +692,7 @@ MapEditor.map.init('gmap', places); } - + } })();