From 05ee6868a11dadc1ac4e49de1ad06c41b5b2eb04 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Mon, 2 Mar 2020 23:13:36 +0000 Subject: [PATCH] Fix support for older browsers (Most notability pre iOS 10). (#16) A chart can be seen here showing the browsers that support arrow functions: https://caniuse.com/#feat=es6 --- html/layers.js | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/html/layers.js b/html/layers.js index d9e7e82..74e150d 100644 --- a/html/layers.js +++ b/html/layers.js @@ -253,27 +253,29 @@ function createBaseLayers() { projection: 'EPSG:3857' }) }), - style: (feature) => new ol.style.Style({ - fill: new ol.style.Fill({ - color : fill - }), - stroke: new ol.style.Stroke({ - color: stroke, - width: 1 - }), - text: new ol.style.Text({ - text: feature.get("name"), - overflow: OLMap.getView().getZoom() > 5, - scale: 1.25, + style: function style(feature) { + return new ol.style.Style({ fill: new ol.style.Fill({ - color: '#000000' + color : fill }), stroke: new ol.style.Stroke({ - color: '#FFFFFF', - width: 2 + color: stroke, + width: 1 + }), + text: new ol.style.Text({ + text: feature.get("name"), + overflow: OLMap.getView().getZoom() > 5, + scale: 1.25, + fill: new ol.style.Fill({ + color: '#000000' + }), + stroke: new ol.style.Stroke({ + color: '#FFFFFF', + width: 2 + }) }) - }) - }) + }); + } }); };