-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildings.html
46 lines (41 loc) · 1.13 KB
/
buildings.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<html>
<head>
<script src="https://apiv3.geoportail.lu/apiv3loader.js" type="text/javascript"></script>
</head>
<body>
<div id="map"></div>
<script>
displayedBuildingsFeatures = new ol.Collection();
var fillStyle = new ol.style.Fill({
color: [255, 255, 0, 0.6]
});
var strokeStyle = new ol.style.Stroke({
color: [255, 155, 55, 1],
width: 3
});
vectorStyle_ = new ol.style.Style({
fill: fillStyle,
stroke: strokeStyle
});
map = new lux.Map({
target: 'map',
bgLayer: 'topogr_global',
zoom: 18,
position: [75977, 75099]
});
buildingLayer = new ol.layer.Vector({
source: new ol.source.Vector({features:displayedBuildingsFeatures}),
map: map,
style: vectorStyle_
});
fetch("https://map.geoportail.lu/getfeatureinfo?fids=199_5979,199_5609,199_5688").then(function(resp) {
return resp.json();
}).then(function(data) {
for (var i = 0; i < data.length;i++) {
var curFeature = (new ol.format.GeoJSON().readFeature(data[i].features[0].geometry, {dataProjection:'EPSG:2169', featureProjection: 'EPSG:3857'}));
displayedBuildingsFeatures.push(curFeature);
}
}.bind(this));
</script>
</body>
</html>