From 805d96fac47eab619208e04d748550e48bd90654 Mon Sep 17 00:00:00 2001 From: Tim Appelhans Date: Wed, 17 Apr 2024 11:25:41 +0200 Subject: [PATCH] ensure options are properly set for layer. addresses #31 --- inst/htmlwidgets/lib/FlatGeoBuf/fgb.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/inst/htmlwidgets/lib/FlatGeoBuf/fgb.js b/inst/htmlwidgets/lib/FlatGeoBuf/fgb.js index 3b9b797..d69399d 100644 --- a/inst/htmlwidgets/lib/FlatGeoBuf/fgb.js +++ b/inst/htmlwidgets/lib/FlatGeoBuf/fgb.js @@ -100,16 +100,19 @@ LeafletWidget.methods.addFlatGeoBuf = function (layerId, }); } - lyr = L.geoJSON(result.value, { - pointToLayer: function (feature, latlng) { + lyr = L.geoJSON(result.value, Object.assign( + { + pointToLayer: function (feature, latlng) { return L.circleMarker(latlng, options); + }, + style: function(feature) { + return updateStyle(style, feature, scale, scaleFields); + }, + onEachFeature: pop, + pane: pane }, - style: function(feature) { - return updateStyle(style, feature, scale, scaleFields); - }, - onEachFeature: pop, - pane: pane - }); + options) + ); if (label) { if (Object.keys(result.value.properties).includes(label)) {