Remove jquery from getfeatureinfo-layers example
This commit is contained in:
@@ -9,8 +9,6 @@ docs: >
|
||||
`ol.format.WMSGetFeatureInfo` format object, which allows features returned
|
||||
by a single WMS GetFeatureInfo request that asks for more than one layer
|
||||
to be read by layer name.
|
||||
resources:
|
||||
- https://code.jquery.com/jquery-1.11.2.min.js
|
||||
---
|
||||
<table id="info">
|
||||
<tr>
|
||||
|
||||
@@ -1,24 +1,23 @@
|
||||
goog.require('ol.format.WMSGetFeatureInfo');
|
||||
|
||||
$.ajax({
|
||||
url: './data/wmsgetfeatureinfo/osm-restaurant-hotel.xml',
|
||||
success: function(response) {
|
||||
fetch('data/wmsgetfeatureinfo/osm-restaurant-hotel.xml').then(function(response) {
|
||||
return response.text();
|
||||
}).then(function(response) {
|
||||
|
||||
// this is the standard way to read the features
|
||||
var allFeatures = new ol.format.WMSGetFeatureInfo().readFeatures(response);
|
||||
$('#all').html(allFeatures.length.toString());
|
||||
// this is the standard way to read the features
|
||||
var allFeatures = new ol.format.WMSGetFeatureInfo().readFeatures(response);
|
||||
document.getElementById('all').innerText = allFeatures.length.toString();
|
||||
|
||||
// when specifying the 'layers' options, only the features of those
|
||||
// layers are returned by the format
|
||||
var hotelFeatures = new ol.format.WMSGetFeatureInfo({
|
||||
layers: ['hotel']
|
||||
}).readFeatures(response);
|
||||
$('#hotel').html(hotelFeatures.length.toString());
|
||||
// when specifying the 'layers' options, only the features of those
|
||||
// layers are returned by the format
|
||||
var hotelFeatures = new ol.format.WMSGetFeatureInfo({
|
||||
layers: ['hotel']
|
||||
}).readFeatures(response);
|
||||
document.getElementById('hotel').innerText = hotelFeatures.length.toString();
|
||||
|
||||
var restaurantFeatures = new ol.format.WMSGetFeatureInfo({
|
||||
layers: ['restaurant']
|
||||
}).readFeatures(response);
|
||||
$('#restaurant').html(restaurantFeatures.length.toString());
|
||||
var restaurantFeatures = new ol.format.WMSGetFeatureInfo({
|
||||
layers: ['restaurant']
|
||||
}).readFeatures(response);
|
||||
document.getElementById('restaurant').innerText = restaurantFeatures.length.toString();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user