Use blocked scoped variables
In addition to using const and let, this also upgrades our linter config and removes lint (mostly whitespace).
This commit is contained in:
@@ -5,17 +5,17 @@ fetch('data/wmsgetfeatureinfo/osm-restaurant-hotel.xml').then(function(response)
|
||||
}).then(function(response) {
|
||||
|
||||
// this is the standard way to read the features
|
||||
var allFeatures = new WMSGetFeatureInfo().readFeatures(response);
|
||||
const allFeatures = new 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 WMSGetFeatureInfo({
|
||||
const hotelFeatures = new WMSGetFeatureInfo({
|
||||
layers: ['hotel']
|
||||
}).readFeatures(response);
|
||||
document.getElementById('hotel').innerText = hotelFeatures.length.toString();
|
||||
|
||||
var restaurantFeatures = new WMSGetFeatureInfo({
|
||||
const restaurantFeatures = new WMSGetFeatureInfo({
|
||||
layers: ['restaurant']
|
||||
}).readFeatures(response);
|
||||
document.getElementById('restaurant').innerText = restaurantFeatures.length.toString();
|
||||
|
||||
Reference in New Issue
Block a user