Skip to content
Snippets Groups Projects
Commit 3840a89b authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Merge branch 'barkbeetle_n5' into 'develop'

Bugfix: Now using a more detailed polygon service for municipality search

See merge request !174
parents 5ab84f07 2c5e22c2
No related branches found
No related tags found
1 merge request!174Bugfix: Now using a more detailed polygon service for municipality search
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
<script type="text/javascript" src="/js/3rdparty/moment.min.js"></script> <script type="text/javascript" src="/js/3rdparty/moment.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">
var theForm = document.getElementById("${formId}"); var theForm = document.getElementById("${formId}");
const municipalityPolygonServiceUrl = "https://proxy03.nibio.no/municipality_cache_ws/kommuneListe/N5/4326";
$(document).ready(function() { $(document).ready(function() {
// Make sure that there is a date picker present for HTML5 // Make sure that there is a date picker present for HTML5
// date input fields // date input fields
...@@ -73,7 +74,7 @@ ...@@ -73,7 +74,7 @@
}); });
// Get County and municipality // Get County and municipality
fetch("/corsproxy/https://proxy1.nibio.no/municipality_cache_ws/kommuneListe/N2000/4326/?lon=" + lon + "&lat=" + lat) fetch("/corsproxy/" + municipalityPolygonServiceUrl + "?lon=" + lon + "&lat=" + lat)
.then(response => response.json()) .then(response => response.json())
.then(municInfo =>{ .then(municInfo =>{
if(municInfo.length == 0) if(municInfo.length == 0)
...@@ -97,7 +98,7 @@ ...@@ -97,7 +98,7 @@
.catch( error => console.info(error)); .catch( error => console.info(error));
// Get County and municipality from before 2018 // Get County and municipality from before 2018
fetch("/corsproxy/https://proxy1.nibio.no/municipality_cache_ws/kommuneListe/N2000/4326/2017?lon=" + lon + "&lat=" + lat) fetch("/corsproxy//" + municipalityPolygonServiceUrl + "/2017?lon=" + lon + "&lat=" + lat)
.then(response => response.json()) .then(response => response.json())
.then(municInfo =>{ .then(municInfo =>{
if(municInfo.length == 0) if(municInfo.length == 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment