1 | goog.require('ol.format.WMSGetFeatureInfo');
|
2 |
|
3 | fetch('data/wmsgetfeatureinfo/osm-restaurant-hotel.xml').then(function(response) {
|
4 | return response.text();
|
5 | }).then(function(response) {
|
6 |
|
7 |
|
8 | var allFeatures = new ol.format.WMSGetFeatureInfo().readFeatures(response);
|
9 | document.getElementById('all').innerText = allFeatures.length.toString();
|
10 |
|
11 |
|
12 |
|
13 | var hotelFeatures = new ol.format.WMSGetFeatureInfo({
|
14 | layers: ['hotel']
|
15 | }).readFeatures(response);
|
16 | document.getElementById('hotel').innerText = hotelFeatures.length.toString();
|
17 |
|
18 | var restaurantFeatures = new ol.format.WMSGetFeatureInfo({
|
19 | layers: ['restaurant']
|
20 | }).readFeatures(response);
|
21 | document.getElementById('restaurant').innerText = restaurantFeatures.length.toString();
|
22 |
|
23 | });
|