From 1a49b365950d430b5681b23f1173a337e8b1b0df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Vigh?= Date: Fri, 30 Apr 2021 16:20:23 +0200 Subject: [PATCH] organised Leaflet map and Google Maps into wrappers --- public/static/img/markers/m1.png | Bin 0 -> 3003 bytes public/static/img/markers/m2.png | Bin 0 -> 3259 bytes public/static/img/markers/m3.png | Bin 0 -> 3956 bytes public/static/img/markers/m4.png | Bin 0 -> 5705 bytes public/static/img/markers/m5.png | Bin 0 -> 6839 bytes public/static/js/map_editor.js | 310 +++++++++++++++++++++++-------- views/admin/map_editor.php | 1 + 7 files changed, 233 insertions(+), 78 deletions(-) create mode 100644 public/static/img/markers/m1.png create mode 100644 public/static/img/markers/m2.png create mode 100644 public/static/img/markers/m3.png create mode 100644 public/static/img/markers/m4.png create mode 100644 public/static/img/markers/m5.png diff --git a/public/static/img/markers/m1.png b/public/static/img/markers/m1.png new file mode 100644 index 0000000000000000000000000000000000000000..329ff524c59e4ac6ba91db135e2257106253d7b9 GIT binary patch literal 3003 zcmV;s3qPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iXJ| z2r3bh0E3kP01G=wL_t(&-o2Vzj9q7S$AABQX2xTW$M(c=Vw^w|nxv@{1u$6Lp-Ky> z+Heu!fwodn5%56Z1ca1j>?!8rnn2T)Z6sCkHxDm5yJkb+93CZRwCC@~?$Zb;HN z#N*iG8IR|F&i?bT*WTxwiOs&+2FL&b4WNMy(g=2e z)B%iLzLtLldDgqXsSQnG{dczt>WP%^M}bkKp)e#v%EEwnng|2I7E*!TMe1U&AT7|; z%0|~!>+(cXrBNWHF<@sH0k)CKac$Snh>vOm;ljUz72qteR4-cp0&c2NJ%ci&o!C3V z8w^8GT>98JxyH7vE}aBCIYk#+-Fgi;k=l}C&{2h1aN zE;^C6!QO_n1ABXKMu~CdSOwB)n(7Q{nAYSS*aK__iu(T2J00u=qie}4FNogkQ4Ay z?5lu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nRBhMbg{&k|sT^D-9U&ZI?1lNXi$x%afY(paq-bt&t75HbQ*}8=zy&CvO z;CAf)NSJ^J@J`we`YiA@?2pwvv*dlhqp5qbZ>!Uf)WCiU7_Zq+Io2Y1MwZkn(@6pr za0T!T(%E=lAiX>k)bA&BWf?dW8pZpt?+hT(MU!){R|W7Z-~je_kvRy4&XgVO9?P6V1Fx`a<5Gk-VV}(*gI>juw0|Fl`O5k z@_Yn)Z}RY}ZF30wn!3YLhU$MJ9mf7p7*naU0!{(X0{eL0qn$ZZg1APjVv7ZIL5#fI*SVgrMFOX-C()LUG_~{w)Z1H@S-mHo3 zR2<-_XvZjR@4|j45^c3t3gFGy+mSwveIIZR7>$j4GL88Xip1}D<|KLcD6Qhk1YCr@lp1t?=}{?0_L;uTyfZl1kC7H?gUe948T(DZ!$^6^ z$aBE|)70`MsL*f2+b;ku^6WDq^4y7ZZD03f8tLb>y)RDA5Mka0ruubDT|&WXB}MC0u+($&#Ss~+44#&IkNi&sdbt z=>X4>XFrHA-k&tatNmOW)FTe-I2=-f!4*`ezRFN^Alyu7a4(JK+bH%=$+P1Fj6DI| z9(!X6I10QFIcZP5e|il$M^btxgXrsnJ-IpxmuKDB2UEcXRr4;#0V)_7SY;}`xf6RFdpKDr z)m?de5@~i&gErRlEhjY=q;j~9`M&HvfMM0)tn?Jx64HF#by;IaaqYdwvWZ=Ja4z=R xi_!k+Bn*4dYdJi$9NNgq0E6-n$U0i2e*pgzX-8pBlM(;`002ovPDHLkV1iGktbG6g literal 0 HcmV?d00001 diff --git a/public/static/img/markers/m2.png b/public/static/img/markers/m2.png new file mode 100644 index 0000000000000000000000000000000000000000..b999cbcf69441f194768157d79a113b0fae03e3c GIT binary patch literal 3259 zcmV;s3`FyZP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iXJ| z2q`s%E;NS#01P`xL_t(&-o=_*Y^7&)hM)KM_F)`*4xUNE_0hLw-_KzSa zVYuKVxBwCf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RCKRKDV0Rxp82_8IVR-Vud0|cEe7R)80Bb2UNG#Ea#_Dg{ouOlyf*Oele9+{ z)n#Qj(~`0U+2`n-_q40pQnoV`XzKwkKnj~QA!cEz3KXhHzY%#slX+M4`d)GTdmV4< zypi5ICGM&gvCw$pNR2aT47+5TBV`OyGE%9IBzNd`{-Mqt8L$m<=`=5v4jME zwhV4i*rPJ&tDdHHld|Ht!j4kvIIs6cr$MH@z0y_SlG-^ruYr5nHWRq8D`TRBa!b2c zCok!WPNyC>IX&WO@;59qqG#5nh~VDoX<-+F+%)on-7(Nij69#iSCky=B8 zWsTEU>yprcIpC1*j;&P9^!z0tB7PJZ&^2s9pxyHEw;Q!dETpF^rX&uH%APlPyEp)J zBZ{pN*3@I6Qmz>tMm+`C!Qgf_V!|7}yDnM>79<5tQB(D70~1Amt5=!w&?Uh1jyTn@ zEmCwt4i()j;6jDEqJUZga7^!t{*&%nRAmjeCf?J~q69eIbdFuQ8NDl;ee!e!s;$K3 vjj+ZudDk%EUh0hRsTA1SD0N)z`o94Hp>J(tm=v(I00000NkvXXu0mjfCr9_Z literal 0 HcmV?d00001 diff --git a/public/static/img/markers/m5.png b/public/static/img/markers/m5.png new file mode 100644 index 0000000000000000000000000000000000000000..61387d2ab5c8d22efef4846617567a3b1ae6d72e GIT binary patch literal 6839 zcmV;o8c5}dP)KLZ*U+=)p!fv7f#TG` zAxLl%!EgG`&*5<32cu%worY0{L9A7~=}6b}76Isk~1IN~P)K3@?4 z&zpALY4A7Z!>t0&I7qECf*j`WHIYAjW_h^ivJu4lvb8y9VL`DD`rG0ZKvcZ$L@8 zo)6*!Fng}&gE0q~LGCMnsiR8`P)pL0I_sTkS+y)n+TA3GebL))$`zPyB#}i;vpt> zLLd%=I3q+TkOe{@7A!zw2TPWbvSNdT62yXthz%fiNPq$+195Cj66`p(zB>*$BqWgX9JhrUc>v7R-~u^B{E_ zRNwKukD}6E^I^<(eYPUNRzv61Pl7Im-uqb+bjIE`FfKtC0bd6-?ajjV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f3xMbnk+k zEl-L$nY4>5q-kOMWC-sQ-k;*8vol8eFgLW%!#eL%f{C+9+x>zzykGWXdv%UO1F(9D zVQ@;&Sm?VgmdBEF8f%f83?6K*Ze99fFoKO5jEu>;&nlCgXMEm6IRe5}fobzv8Shq* z>8$wp_ca?yTE>L<>IlK!6t-tm{*Skl(CwInd|CUvH!zZ>w9rEVOpe`LlmUN7*EdrI z)|RzSERLdc>k)KjA*!(Si5hRt+N!{c&nC^LqvbghoEZybzAdfVFK6R=ntsa*Aw_g6 zTppp(_L8iBC&g%dr^2B-)T~s52Pfo0`%uH;?`VZx(@c@6idI^!TELbBRo&HCYSt!f zGsTy4<$uh!Oja>yJFcaCM6DHVxuo4NfkrpT+M;B86(>2#iuHOo9mtZ0bMKSG($!u2YG?(#ql=%X zns(j}Vbgw%n(fv9&$GT~qh#Ub0pRhe6@zfxVnn#}v~W3xJ-5}ih2hcpbF5+h|9Z-H zWyP(YRfzRwllq@#kJ>c_{NE*~Bx`3;Wopc1z!tUi*O>tDBEXu;0fuIOgh(XwGI-hW zwlzV0EZn$|F)7b+mNgE!T5o-HSG2ECJS0>+l@k~nV6xOcuOTFtg~>;hgKJa--wQDo zjbFQ&p#4_oHmkVC6vI{K4N z;^|70m)PX7#!=WFsNARr6XpwPO9+?ro|1;o2)}dcesG)Tm5W*?b#s@fiZL(M?7~El z!-%J2c)xg+0|39UMx;?Zb^ibW002ovPDHLkV1n(iOrih) literal 0 HcmV?d00001 diff --git a/public/static/js/map_editor.js b/public/static/js/map_editor.js index 097b0d8..e966b73 100644 --- a/public/static/js/map_editor.js +++ b/public/static/js/map_editor.js @@ -7,7 +7,6 @@ description: null }, map: null, - markers: null, panorama: null, selectedMarker: null, added: {}, @@ -124,10 +123,7 @@ MapEditor.panorama.setVisible(false); if (marker.placeId) { - MapEditor.markers.removeLayer(MapEditor.selectedMarker); - MapEditor.map.addLayer(MapEditor.selectedMarker); - marker.setIcon(IconCollection.iconBlue); - marker.setZIndexOffset(2000); + MapEditor.map.changeMarkerIcon(marker, MapEditor.map.iconCollection.iconBlue); document.getElementById('deleteButton').style.display = 'block'; @@ -165,13 +161,13 @@ var placeId = MapEditor.selectedMarker.placeId if (places[placeId].id && !del) { - MapEditor.map.removeLayer(MapEditor.selectedMarker); - MapEditor.markers.addLayer(MapEditor.selectedMarker); - MapEditor.selectedMarker.setIcon(places[placeId].noPano ? IconCollection.iconRed : IconCollection.iconGreen); - MapEditor.selectedMarker.setZIndexOffset(1000); + MapEditor.map.changeMarkerIcon( + MapEditor.selectedMarker, + places[placeId].noPano ? MapEditor.map.iconCollection.iconRed : MapEditor.map.iconCollection.iconGreen + ); } else { delete places[placeId]; - MapEditor.map.removeLayer(MapEditor.selectedMarker); + MapEditor.map.removeMarker(MapEditor.selectedMarker); } document.getElementById('deleteButton').style.display = 'none'; @@ -310,42 +306,9 @@ var placeId = addedPlaces[i].id; places[tempId].id = placeId; } - }, - - // TODO: check whether marker is already existing on the map for the coordinates - // or alternatively block saving for matching coordinates - placeMarker: function (latlng) { - var marker = L.marker(latlng, { - icon: IconCollection.iconBlue, - zIndexOffset: 2000 - }) - .addTo(MapEditor.map) - .on('click', function () { - MapEditor.select(this); - }); - - MapEditor.select(marker); } }; - var IconCollection = { - iconGreen: L.icon({ - iconUrl: STATIC_ROOT + '/img/markers/marker-green.svg?rev' + REVISION, - iconSize: [24, 32], - iconAnchor: [12, 32] - }), - iconRed: L.icon({ - iconUrl: STATIC_ROOT + '/img/markers/marker-red.svg?rev=' + REVISION, - iconSize: [24, 32], - iconAnchor: [12, 32] - }), - iconBlue: L.icon({ - iconUrl: STATIC_ROOT + '/img/markers/marker-blue.svg?rev=' + REVISION, - iconSize: [24, 32], - iconAnchor: [12, 32] - }), - }; - var Util = { getHighResData: function () { if (window.devicePixelRatio >= 4) { @@ -384,52 +347,243 @@ } }; - MapEditor.map = L.map('map', { - zoomControl: false - }); + var LMapWrapper = { + map: null, + markers: null, + iconCollection: { + iconGreen: L.icon({ + iconUrl: STATIC_ROOT + '/img/markers/marker-green.svg?rev' + REVISION, + iconSize: [24, 32], + iconAnchor: [12, 32] + }), + iconRed: L.icon({ + iconUrl: STATIC_ROOT + '/img/markers/marker-red.svg?rev=' + REVISION, + iconSize: [24, 32], + iconAnchor: [12, 32] + }), + iconBlue: L.icon({ + iconUrl: STATIC_ROOT + '/img/markers/marker-blue.svg?rev=' + REVISION, + iconSize: [24, 32], + iconAnchor: [12, 32] + }) + }, - MapEditor.map.on('click', function (e) { - MapEditor.placeMarker(e.latlng); - }); + init: function (divId, places) { + LMapWrapper.map = L.map('map', { + zoomControl: false + }); - var highResData = Util.getHighResData(); + LMapWrapper.map.on('click', function (e) { + LMapWrapper.placeMarker(e.latlng); + }); - L.tileLayer(tileUrl, { - attribution: tileAttribution, - subdomains: '1234', - ppi: highResData.ppi, - tileSize: highResData.tileSize, - zoomOffset: highResData.zoomOffset, - minZoom: highResData.minZoom, - maxZoom: highResData.maxZoom - }).addTo(MapEditor.map); + var highResData = Util.getHighResData(); - MapEditor.map.fitBounds(L.latLngBounds({ lat: mapBounds.south, lng: mapBounds.west }, { lat: mapBounds.north, lng: mapBounds.east })); + L.tileLayer(tileUrl, { + attribution: tileAttribution, + subdomains: '1234', + ppi: highResData.ppi, + tileSize: highResData.tileSize, + zoomOffset: highResData.zoomOffset, + minZoom: highResData.minZoom, + maxZoom: highResData.maxZoom + }).addTo(LMapWrapper.map); - MapEditor.markers = L.markerClusterGroup({ - maxClusterRadius: 50 - }); + LMapWrapper.map.fitBounds(L.latLngBounds({ lat: mapBounds.south, lng: mapBounds.west }, { lat: mapBounds.north, lng: mapBounds.east })); - for (var placeId in places) { - if (!places.hasOwnProperty(placeId)) { - continue; + LMapWrapper.loadMarkers(places); + }, + + loadMarkers: function (places) { + + LMapWrapper.markers = L.markerClusterGroup({ + maxClusterRadius: 50 + }); + + for (var placeId in places) { + if (!places.hasOwnProperty(placeId)) { + continue; + } + + var place = places[placeId]; + + var marker = L.marker({ lat: place.lat, lng: place.lng }, { + icon: place.noPano ? LMapWrapper.iconCollection.iconRed : LMapWrapper.iconCollection.iconGreen, + zIndexOffset: 1000 + }) + .addTo(LMapWrapper.markers) + .on('click', function () { + MapEditor.select(this); + }); + + marker.placeId = place.id; + } + + LMapWrapper.map.addLayer(LMapWrapper.markers); + }, + + // TODO: check whether marker is already existing on the map for the coordinates + // or alternatively block saving for matching coordinates + placeMarker: function (latLng) { + var marker = L.marker(latLng, { + icon: LMapWrapper.iconCollection.iconBlue, + zIndexOffset: 2000 + }) + .addTo(LMapWrapper.map) + .on('click', function () { + MapEditor.select(this); + }); + + MapEditor.select(marker); + }, + + panTo: function (latLng) { + LMapWrapper.map.panTo(latLng); + }, + + invalidateSize: function (invalid) { + LMapWrapper.map.invalidateSize(invalid); + }, + + changeMarkerIcon: function (marker, icon) { + LMapWrapper.markers.removeLayer(marker); + LMapWrapper.map.addLayer(marker); + marker.setIcon(icon); + marker.setZIndexOffset(2000); + }, + + removeMarker: function (marker) { + LMapWrapper.map.removeLayer(marker); } + }; - var place = places[placeId]; + var GMapWrapper = { + map: null, + markers: null, + iconCollection: { + iconGreen: { + url: STATIC_ROOT + '/img/markers/marker-green.svg?rev' + REVISION, + scaledSize: new google.maps.Size(24, 32), // scaled size + origin: new google.maps.Point(0, 0), // origin + anchor: new google.maps.Point(12, 32) // anchor + }, + iconRed: { + url: STATIC_ROOT + '/img/markers/marker-red.svg?rev' + REVISION, + scaledSize: new google.maps.Size(24, 32), // scaled size + origin: new google.maps.Point(0, 0), // origin + anchor: new google.maps.Point(12, 32) // anchor + }, + iconBlue: { + url: STATIC_ROOT + '/img/markers/marker-blue.svg?rev' + REVISION, + scaledSize: new google.maps.Size(24, 32), // scaled size + origin: new google.maps.Point(0, 0), // origin + anchor: new google.maps.Point(12, 32) // anchor + } + }, - var marker = L.marker({ lat: place.lat, lng: place.lng }, { - icon: place.noPano ? IconCollection.iconRed : IconCollection.iconGreen, - zIndexOffset: 1000 - }) - .addTo(MapEditor.markers) - .on('click', function () { + init: function (divId, places) { + GMapWrapper.map = new google.maps.Map(document.getElementById(divId), { + center: { lat: 48.2207779, lng: 16.3098489 }, + zoom: 2, + fullscreenControl: false, + zoomControl: true, + zoomControlOptions: { + position: google.maps.ControlPosition.LEFT_BOTTOM + }, + streetViewControl: true, + streetViewControlOptions: { + position: google.maps.ControlPosition.LEFT_BOTTOM + }, + draggableCursor: 'crosshair' + }); + + GMapWrapper.map.addListener('click', function (mapsMouseEvent) { + GMapWrapper.placeMarker({ + lat: mapsMouseEvent.latLng.lat(), + lng: mapsMouseEvent.latLng.lng() + }); + }); + + GMapWrapper.loadMarkers(places); + }, + + loadMarkers: function (places) { + GMapWrapper.markers = new MarkerClusterer(GMapWrapper.map, [], { + imagePath: STATIC_ROOT + '/img/markers/m', + imageExtension: 'png?rev' + REVISION + }); + + for (var placeId in places) { + if (!places.hasOwnProperty(placeId)) { + continue; + } + + var place = places[placeId]; + + var marker = new google.maps.Marker({ + position: { + lat: place.lat, + lng: place.lng + }, + icon: place.noPano ? GMapWrapper.iconCollection.iconRed : GMapWrapper.iconCollection.iconGreen + }); + + marker.getLatLng = function () { return { lat: this.getPosition().lat(), lng: this.getPosition().lng() } }; + marker.setLatLng = function (coords) { this.setPosition(coords) }; + + marker.addListener('click', function () { + MapEditor.select(this); + }); + + marker.placeId = place.id; + + GMapWrapper.markers.addMarker(marker); + } + }, + + // TODO: check whether marker is already existing on the map for the coordinates + // or alternatively block saving for matching coordinates + placeMarker: function (latLng) { + var marker = new google.maps.Marker({ + map: GMapWrapper.map, + position: latLng, + icon: GMapWrapper.iconCollection.iconBlue, + }); + + marker.getLatLng = function () { return { lat: this.getPosition().lat(), lng: this.getPosition().lng() } }; + marker.setLatLng = function (coords) { this.setPosition(coords) }; + + marker.addListener('click', function () { MapEditor.select(this); }); - marker.placeId = place.id; - } + GMapWrapper.markers.addMarker(marker); - MapEditor.map.addLayer(MapEditor.markers); + MapEditor.select(marker); + }, + + panTo: function (latLng) { + GMapWrapper.map.panTo(latLng); + }, + + invalidateSize: function (invalid) { + if (invalid) { + google.maps.event.trigger(GMapWrapper.map, 'resize'); + } + }, + + changeMarkerIcon: function (marker, icon) { + marker.setIcon(icon); + }, + + removeMarker: function (marker) { + GMapWrapper.markers.removeMarker(marker); + } + }; + + // MapEditor.map = LMapWrapper; + MapEditor.map = GMapWrapper; + MapEditor.map.init('map', places); MapEditor.panorama = new google.maps.StreetViewPanorama(document.getElementById('panorama'), { // switch off fullscreenControl because positioning doesn't work @@ -478,7 +632,7 @@ var coordinates = Util.extractCoordinates(coordinatesStr); if (coordinates.valid) { - MapEditor.placeMarker(coordinates.latlng); + MapEditor.map.placeMarker(coordinates.latlng); } }; @@ -491,7 +645,7 @@ jumpButton.disabled = false; if (e.key == 'Enter') { - MapEditor.placeMarker(coordinates.latlng); + MapEditor.map.placeMarker(coordinates.latlng); } } else { diff --git a/views/admin/map_editor.php b/views/admin/map_editor.php index c6de87b..4a42eee 100644 --- a/views/admin/map_editor.php +++ b/views/admin/map_editor.php @@ -6,6 +6,7 @@ @js(node_modules/leaflet/dist/leaflet.js) @js(node_modules/leaflet.markercluster/dist/leaflet.markercluster.js) @js(https://maps.googleapis.com/maps/api/js?key=) +@js(https://unpkg.com/@googlemaps/markerclustererplus/dist/index.min.js) @js(js/map_editor.js) @extends(templates/layout_full)