diff --git a/assets/js/buscador.js b/assets/js/buscador.js index a95860e..4211d6e 100644 --- a/assets/js/buscador.js +++ b/assets/js/buscador.js @@ -18,7 +18,8 @@ function viajar(bbox) { [ bbox[2], bbox[0] ], [ bbox[3], bbox[1] ] ], { - padding: { top: 10, bottom:25, left: 15, right: 5 } + padding: { top: 10, bottom:25, left: 15, right: 5 }, + duration: 0 }); }; diff --git a/assets/js/buscador.min.js b/assets/js/buscador.min.js index 58aad49..d01f90d 100644 --- a/assets/js/buscador.min.js +++ b/assets/js/buscador.min.js @@ -1 +1 @@ -var bbox,searchLat,searchLon,respuesta="",lugar="";function keypressInBox(a){13==(a.keyCode?a.keyCode:a.which)&&(a.preventDefault(),buscar(lugar=$("#buscarLugar")[0].value))}function viajar(a){map.fitBounds([[a[2],a[0]],[a[3],a[1]]],{padding:{top:10,bottom:25,left:15,right:5}})}function buscar(a){$.getJSON("https://nominatim.openstreetmap.org/search?format=json&limit=1&q="+a,function(a){$.each(a,function(a,e){bbox=e.boundingbox}),viajar(bbox)})}$("#buscarLugar").bind("keypress",{},keypressInBox); \ No newline at end of file +function keypressInBox(a){var r=a.keyCode?a.keyCode:a.which;13==r&&(a.preventDefault(),lugar=$("#buscarLugar")[0].value,buscar(lugar))}function viajar(a){map.fitBounds([[a[2],a[0]],[a[3],a[1]]],{padding:{top:10,bottom:25,left:15,right:5},duration:0})}function buscar(a){$.getJSON("https://nominatim.openstreetmap.org/search?format=json&limit=1&q="+a,function(a){$.each(a,function(a,r){bbox=r.boundingbox}),viajar(bbox)})}var bbox,searchLat,searchLon,respuesta="",lugar="";$("#buscarLugar").bind("keypress",{},keypressInBox); \ No newline at end of file