Skip to main content
Tim van Heteren's user avatar
Tim van Heteren's user avatar
Tim van Heteren's user avatar
Tim van Heteren
  • Member for 5 years, 11 months
  • Last seen more than 3 years ago
Stats
53
reputation
7k
reached
0
answers
5
questions
About

function initMap() {let osmLayer = new ol.layer.Tile({ source: new ol.source.OSM(), title: 'OSM basemap', type: 'base' }); let ESRILayer = new ol.layer.Tile({ source: new ol.source.XYZ({ url: 'https://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer/tile/{z}/{y}/{x}', attributions: ['Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'] }) }); map = new ol.Map({ target: 'map', layers: [osmLayer, stamenLayer], view: denboschView });let pandenDBSource = new ol.source.ImageWMS({ url: 'https://gmd.has.nl/geoserver/proefstudeerdag/wms', params: { 'LAYERS': 'proefstudeerdag:pandendb' } }); let pandenDBLayer = new ol.layer.Image({ source: pandenDBSource, title: 'Panden Den Bosch', visible: false }); map.addLayer(pandenDBLayer); map.on('singleclick', function(evt) { let viewResolution = /** @type {number} */ (denboschView.getResolution()); let getFeatureInfoUrl = pandenDBSource.getGetFeatureInfoUrl( evt.coordinate, viewResolution, 'EPSG:3857', { 'INFO_FORMAT': 'application/json' }); if (getFeatureInfoUrl) { // document.getElementById('info').innerHTML = // ''; console.log(getFeatureInfoUrl); $.ajax({ url: getFeatureInfoUrl, dataType: 'json' }).done(function(data) { $("#bouwjaar").html(data.features[0].properties.bouwjaar); $("#status").html(data.features[0].properties.status); $("#gebruiksdoel").html(data.features[0].properties.gebruiksdoel); }); }}); var layerSwitcher = new ol.control.LayerSwitcher({ tipLabel: 'Légende', // Optional label for button groupSelectStyle: 'children' // Can be 'children' [default], 'group' or 'none'}); map.addControl(layerSwitcher); } // end of Initmap /*JavaScript bestand met code om OpenLayers kaart te maken */$(document).ready(function() { initMap();}); enter image description here enter image description here enter image description here

This user doesn’t have any gold badges yet.
1
silver badge
8
bronze badges
0
Score
2
Posts
40
Posts %
0
Score
2
Posts
40
Posts %
0
Score
2
Posts
40
Posts %
0
Score
1
Posts
20
Posts %
0
Score
1
Posts
20
Posts %
0
Score
1
Posts
20
Posts %
Top posts