Skip to content

Commit

Permalink
adjust in the JS to update when map shape changes and update the wire…
Browse files Browse the repository at this point in the history
… elements
  • Loading branch information
vitormicillo committed Sep 19, 2024
1 parent 6dbaef4 commit 86bfb3b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion resources/dist/filament-map-picker.js

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion resources/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ document.addEventListener('DOMContentLoaded', () => {
style: {
color: config.liveLocation.color || "#FFFFFF",
fillColor: 'blue',
fillOpacity: 0.6,
fillOpacity: 0.5,
}
});
this.map.addLayer(drawItems);
Expand Down Expand Up @@ -193,6 +193,11 @@ document.addEventListener('DOMContentLoaded', () => {

drawItems.on('pm:edit', (e) => {
geoJsonBox.value = JSON.stringify(drawItems.toGeoJSON());

$wire.set(config.statePath, {
geojson: JSON.stringify(drawItems.toGeoJSON())
}, false)

$wire.$refresh();
});

Expand Down

0 comments on commit 86bfb3b

Please sign in to comment.