diff --git a/src/main/webapp/map_applications/phytophthora/index.html b/src/main/webapp/map_applications/phytophthora/index.html index af52204e4ca549b5c0b98021dc343c2bc7c97211..0b2f644a12cbd10c560f57f2431087e34850392c 100755 --- a/src/main/webapp/map_applications/phytophthora/index.html +++ b/src/main/webapp/map_applications/phytophthora/index.html @@ -309,7 +309,7 @@ // If the first coordinate is > 32, it must be the latitude, since max longitude for Norway is 31-something let longitude = parseFloat(lonLat[0]) > 32 ? lonLat[1] : lonLat[0]; let latitude = parseFloat(lonLat[0]) > 32 ? lonLat[0] : lonLat[1]; - navigateTo([parseFloat(longitude), parseFloat(latitude)]); + navigateTo([parseFloat(longitude), parseFloat(latitude)], 18); return; } $.getJSON( "https://ws.geonorge.no/stedsnavn/v1/navn?sok=" + phrase + "*&utkoordsys=4326&treffPerSide=6&side=1&filtrer=navn.skrivem%C3%A5te%2Cnavn.navneobjekttype%2Cnavn.kommuner%2Cnavn.representasjonspunkt", renderResults); diff --git a/src/main/webapp/map_applications/phytophthora/js/map.js b/src/main/webapp/map_applications/phytophthora/js/map.js index 25e3a97657d032e73435809c00bdd05bec628d84..88585a60997424bb1dd43329f159b2461c3daa34 100755 --- a/src/main/webapp/map_applications/phytophthora/js/map.js +++ b/src/main/webapp/map_applications/phytophthora/js/map.js @@ -647,11 +647,11 @@ var unFocusForm = function () { newFeatureOverlay.getSource().clear(); } -var navigateTo = function (center) { +var navigateTo = function (center, preferredZoom) { var centerPosition = ol.proj.transform(center, 'EPSG:4326', 'EPSG:3857'); view = new ol.View({ center: centerPosition, - zoom: 16 + zoom: preferredZoom != undefined ? preferredZoom : 16 }); map.setView(view);