Skip to content

Commit

Permalink
Add set_data support for ipywidget
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Kuethe committed Jan 21, 2024
1 parent 3eba6d8 commit 5344f29
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions maplibre/srcjs/ipywidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ function getCustomMapMethods(maplibregl2, map) {
marker.setPopup(popup_);
}
marker.addTo(map);
},
setSourceData: function(sourceId, data) {
map.getSource(sourceId).setData(data);
}
};
}
Expand Down
4 changes: 4 additions & 0 deletions srcjs/mapmethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ function getCustomMapMethods(maplibregl, map) {
}
marker.addTo(map);
},

setSourceData: function (sourceId, data) {
map.getSource(sourceId).setData(data);
},
};
}

Expand Down

0 comments on commit 5344f29

Please sign in to comment.