|
@@ -7,10 +7,10 @@ var DEFAULT_MARKER_ICON = L.icon({
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
function setupMap() {
|
|
function setupMap() {
|
|
|
- map = new L.map('map', { zoomControl: false });
|
|
|
|
|
- map.setView([ 52.520008, 13.404954 ], 18);
|
|
|
|
|
|
|
+ map = new L.map('map', { zoomControl: false, attributionControl: false });
|
|
|
|
|
+ map.setView([ 52.520008, 13.404954 ], 20);
|
|
|
L.control.scale({ position: 'bottomright', imperial: false }).addTo(map);
|
|
L.control.scale({ position: 'bottomright', imperial: false }).addTo(map);
|
|
|
- L.control.zoom({ position: 'topright' }).addTo(map);
|
|
|
|
|
|
|
+ // L.control.zoom({ position: 'topright' }).addTo(map);
|
|
|
|
|
|
|
|
L.tileLayer('https://api.mapbox.com/styles/v1/nebulon/{id}/tiles/256/{z}/{x}/{y}@2x?access_token=pk.eyJ1IjoibmVidWxvbiIsImEiOiI3NmNkODc5ZDMyNjcxMWM2M2UyODEyMjdkM2YyMjVlOSJ9.Cpz0-WRwBwE-DNdNfGDu_w', {
|
|
L.tileLayer('https://api.mapbox.com/styles/v1/nebulon/{id}/tiles/256/{z}/{x}/{y}@2x?access_token=pk.eyJ1IjoibmVidWxvbiIsImEiOiI3NmNkODc5ZDMyNjcxMWM2M2UyODEyMjdkM2YyMjVlOSJ9.Cpz0-WRwBwE-DNdNfGDu_w', {
|
|
|
attribution: 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
|
|
attribution: 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
|
|
@@ -42,15 +42,44 @@ function setupMap() {
|
|
|
|
|
|
|
|
history.replaceState({}, window.document.title, u);
|
|
history.replaceState({}, window.document.title, u);
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
|
|
+ var mapillaryKey = 'SmRiZXFSN3RJYVpKdGd2V3BQZ0dMdzoxZjY3YjA3MmU2OWU2ODll';
|
|
|
|
|
+
|
|
|
|
|
+ map.on('contextmenu ', function (event) {
|
|
|
|
|
+ console.log(event);
|
|
|
|
|
+
|
|
|
|
|
+ var popup = L.popup({ closeButton: false })
|
|
|
|
|
+ .setLatLng(event.latlng)
|
|
|
|
|
+ .setContent('<p>Loading address</p>')
|
|
|
|
|
+ .openOn(map);
|
|
|
|
|
+
|
|
|
|
|
+ var params = {
|
|
|
|
|
+ client_id: mapillaryKey,
|
|
|
|
|
+ closeto: event.latlng.lng + ',' + event.latlng.lat,
|
|
|
|
|
+ pano: false
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ axios.get('https://a.mapillary.com/v3/images', {
|
|
|
|
|
+ params: params
|
|
|
|
|
+ }).then(function (response) {
|
|
|
|
|
+ // console.log(response.data);
|
|
|
|
|
+ if (response.data.features.length === 0) {
|
|
|
|
|
+ popup.setContent('<p>Nothing found</p>');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ popup.setContent('<div class="whats-here" style="background-image: url(https://d1cuyjsrcm0gby.cloudfront.net/' + response.data.features[0].properties.key + '/thumb-640.jpg"></div>');
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(function (error) {
|
|
|
|
|
+ console.error(error);
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
app = new Vue({
|
|
app = new Vue({
|
|
|
el: '#app',
|
|
el: '#app',
|
|
|
data: {
|
|
data: {
|
|
|
sidePanelOpen: false,
|
|
sidePanelOpen: false,
|
|
|
- directionsOpen: false,
|
|
|
|
|
querySearchString: '',
|
|
querySearchString: '',
|
|
|
- querySearchStringTo: '',
|
|
|
|
|
querySearchResults: [],
|
|
querySearchResults: [],
|
|
|
searchMarker: {},
|
|
searchMarker: {},
|
|
|
markerDetailsOpen: false,
|
|
markerDetailsOpen: false,
|
|
@@ -72,6 +101,7 @@ app = new Vue({
|
|
|
axios.get('/api/places/details', {
|
|
axios.get('/api/places/details', {
|
|
|
params: params
|
|
params: params
|
|
|
}).then(function (response) {
|
|
}).then(function (response) {
|
|
|
|
|
+ that.sidePanelOpen = true;
|
|
|
that.markerDetailsOpen = true;
|
|
that.markerDetailsOpen = true;
|
|
|
that.markerDetails = item;
|
|
that.markerDetails = item;
|
|
|
that.markerDetails.businessDetails = response.data;
|
|
that.markerDetails.businessDetails = response.data;
|