diff --git a/public/static/img/street-view-cover.svg b/public/static/img/street-view-cover.svg new file mode 100644 index 0000000..393ff4f --- /dev/null +++ b/public/static/img/street-view-cover.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/public/static/js/map_editor.js b/public/static/js/map_editor.js index a96eb7e..b2dab91 100644 --- a/public/static/js/map_editor.js +++ b/public/static/js/map_editor.js @@ -399,6 +399,8 @@ } LMapWrapper.loadMarkers(places); + + document.getElementById('streetViewCoverSelector').disabled = true; }, hide: function () { @@ -466,13 +468,17 @@ removeMarker: function (marker) { LMapWrapper.markers.removeLayer(marker); - } + }, + + toggleStreetViewCover: function () { } }; var GMapWrapper = { map: null, markers: null, divId: null, + streetViewCover: null, + streetViewCoverOn: false, iconCollection: { iconGreen: { url: STATIC_ROOT + '/img/markers/marker-green.svg?rev' + REVISION, @@ -514,6 +520,8 @@ draggableCursor: 'crosshair' }); + GMapWrapper.streetViewCover = new google.maps.StreetViewCoverageLayer(); + GMapWrapper.map.addListener('click', function (mapsMouseEvent) { GMapWrapper.placeMarker({ lat: mapsMouseEvent.latLng.lat(), @@ -525,7 +533,7 @@ GMapWrapper.loadMarkers(places); - GMapWrapper.loaded = true; + document.getElementById('streetViewCoverSelector').disabled = false; }, hide: function () { @@ -605,6 +613,16 @@ removeMarker: function (marker) { GMapWrapper.markers.removeMarker(marker); + }, + + toggleStreetViewCover: function () { + if (GMapWrapper.streetViewCoverOn) { + GMapWrapper.streetViewCover.setMap(null); + GMapWrapper.streetViewCoverOn = false; + } else { + GMapWrapper.streetViewCover.setMap(GMapWrapper.map); + GMapWrapper.streetViewCoverOn = true; + } } }; @@ -691,8 +709,10 @@ MapEditor.map = GMapWrapper; MapEditor.map.init('gmap', places); } + } - + document.getElementById('streetViewCoverSelector').onclick = function () { + MapEditor.map.toggleStreetViewCover(); } })(); diff --git a/views/admin/map_editor.php b/views/admin/map_editor.php index a7234c2..1510b6d 100644 --- a/views/admin/map_editor.php +++ b/views/admin/map_editor.php @@ -18,6 +18,11 @@ Map Selector + +