Skip to content

Commit

Permalink
fix blazor server style callback
Browse files Browse the repository at this point in the history
closes #88
  • Loading branch information
nebula2 committed Oct 21, 2024
1 parent 55eeb45 commit 685e08f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/OpenLayers.Blazor/wwwroot/openlayers_interop.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,10 @@ MapOL.prototype.prepareLayers = function(layers) {
case "VectorTile":
var features;
if (l.useStyleCallback) {
l.style = function (feature, resolution) { return that.getShapeStyle(feature, l.id); };
l.style = function (feature, resolution) {
that.getShapeStyleAsync(feature, l.id)
.then(style => feature.setStyle(style));
};
} else if (l.style) {
var styleOptions = l.style;
l.style = function (feature, resolution) {
Expand Down

0 comments on commit 685e08f

Please sign in to comment.