removed unused css declarations; renamed invalidateSize to resize

This commit is contained in:
Balázs Vigh 2021-05-01 20:28:44 +02:00
parent 2799b19b14
commit aee146ba62
2 changed files with 16 additions and 23 deletions

View File

@ -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 */

View File

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