|
@ -178,9 +178,17 @@ export default class extends Controller { |
|
|
window.open(url, '_blank'); |
|
|
window.open(url, '_blank'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
openInPifomap() { |
|
|
|
|
|
const url = "https://bano.openstreetmap.fr/pifometre/pifomap.html?ratio=N#map="+this.mapInstance.getZoom()+"/"+this.mapInstance.getCenter().lat+"/"+this.mapInstance.getCenter().lng; |
|
|
|
|
|
window.open(url, '_blank'); |
|
|
|
|
|
|
|
|
openInPifometre() { |
|
|
|
|
|
const self = this, url1 = "https://nominatim.openstreetmap.org/reverse?format=json&lat="+this.mapInstance.getCenter().lat+"&lon="+this.mapInstance.getCenter().lng+"&zoom="+this.mapInstance.getZoom()+"&extratags=1"; |
|
|
|
|
|
fetch(url1).then(function (response) { return response.json(); }).then(function (json) { |
|
|
|
|
|
const hasInsee = ((typeof json.extratags === 'undefined') || (json.extratags.hasOwnProperty('ref:INSEE'))); |
|
|
|
|
|
if (hasInsee) { |
|
|
|
|
|
const url2 = "https://bano.openstreetmap.fr/pifometre/?insee="+json.extratags['ref:INSEE']; |
|
|
|
|
|
window.open(url2, '_blank'); |
|
|
|
|
|
} else { |
|
|
|
|
|
window.alert('Impossible de trouver le code INSEE de la commune…'); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
openInGeohack() { |
|
|
openInGeohack() { |
|
|