move maps to folder
This commit is contained in:
parent
d0260c292f
commit
98d4e99464
@ -76,6 +76,8 @@ const metadata = {
|
||||
geocoder: L.Control.Geocoder.nominatim(),
|
||||
position: 'topleft',
|
||||
showAlternatives: true,
|
||||
reverseWaypoints: true,
|
||||
routeWhileDragging: true,
|
||||
altLineOptions: {
|
||||
missingRouteTolerance: 50,
|
||||
extendToWaypoints: true,
|
||||
@ -87,6 +89,8 @@ const metadata = {
|
||||
}
|
||||
}).addTo(map).on('routeselected', (e) => {
|
||||
console.log(e)
|
||||
}).on('routesfound', () =>{
|
||||
console.log("test")
|
||||
})
|
||||
|
||||
|
||||
@ -110,7 +114,6 @@ const metadata = {
|
||||
poiMarkers.forEach(element => {
|
||||
element.remove();
|
||||
});
|
||||
console.log(data);
|
||||
data.features.forEach(element => {
|
||||
const prop = element.properties
|
||||
const popup: Popup = new Popup()
|
||||
@ -130,14 +133,12 @@ const metadata = {
|
||||
|
||||
// fonciton pour lancer la recherche de box sur l'api
|
||||
function sender(){
|
||||
console.log("SEND")
|
||||
if(map.getZoom() >= 13){
|
||||
console.log("zoom OKAY")
|
||||
//TODO: mettre un message de recherche en cour
|
||||
searchBox();
|
||||
}else{
|
||||
console.log("zoom more to see result");
|
||||
//TODO: faire en sorte d'avoir un message
|
||||
}
|
||||
}
|
||||
// envent pour lancer la recherche
|
||||
@ -148,10 +149,17 @@ const metadata = {
|
||||
window.clearTimeout(timeoutHandle);
|
||||
|
||||
map.addEventListener("move",() =>{
|
||||
console.log("move")
|
||||
window.clearTimeout(timeoutHandle);
|
||||
timeoutHandle = window.setTimeout(sender, cooldown);
|
||||
})//searchBox)
|
||||
})
|
||||
|
||||
map.addEventListener("zoom", () => {
|
||||
if(map.getZoom() <= 11){
|
||||
poiMarkers.forEach(element => {
|
||||
element.remove()
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
function search() {
|
||||
const params: URLSearchParams = new URLSearchParams();
|
Loading…
x
Reference in New Issue
Block a user