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

Added infoUri as external link to weather station if part of ExtendedData in KML file

parent 6cb2ebae
No related branches found
No related tags found
No related merge requests found
...@@ -68,11 +68,12 @@ function initForecastMap(lonLat, zoomLevel, mapAttribution) ...@@ -68,11 +68,12 @@ function initForecastMap(lonLat, zoomLevel, mapAttribution)
forecastLayer = new ol.layer.Vector({ forecastLayer = new ol.layer.Vector({
source: new ol.source.Vector({ source: new ol.source.Vector({
url: "http://" + settings.vipslogicServerName + "/rest/forecastresults/aggregate/" + settings.vipsOrganizationId + "?" + buildPathParamString("cropOrganismId", getSelectedCropIds()), url: "http://" + settings.vipslogicServerName + "/rest/forecastresults/aggregate/" + settings.vipsOrganizationId + "?" + buildPathParamString("cropOrganismId", getSelectedCropIds()),
format: new ol.format.KML(), format: new ol.format.KML({"extractAttributes":true}),
projection: ol.proj.get('EPSG:3857') projection: ol.proj.get('EPSG:3857')
}) })
}); });
// Layer for popup // Layer for popup
var popOverlay = new ol.Overlay({ var popOverlay = new ol.Overlay({
element: document.getElementById("popover") element: document.getElementById("popover")
...@@ -190,12 +191,15 @@ function initForecastMap(lonLat, zoomLevel, mapAttribution) ...@@ -190,12 +191,15 @@ function initForecastMap(lonLat, zoomLevel, mapAttribution)
+ "</ul>"; + "</ul>";
} }
console.log(feature);
poiDetails.popover({ poiDetails.popover({
animation: true, animation: true,
trigger: 'manual', trigger: 'manual',
html: true, html: true,
placement: "auto top", placement: "auto top",
title: feature.get("name"), title: feature.get("name") + (feature.get("infoUri") != undefined ?
" <a href='" + feature.get("infoUri") + "' target='new'><span class='fa fa-external-link'></span></a>"
:""),
content: summariesHTML + externalResourceHTML content: summariesHTML + externalResourceHTML
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment