-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
Problem
I would expect the following code to refresh all polygons in the map, not only markers:
// Update the form with the GeoJSON data
$set('geojson', json_encode($geoJsonData));
$set('location', [
'geojson' => $geoJsonData,
'lat' => $geoJsonData["features"][0]["geometry"]["coordinates"][0][0][1] ?? null,
'lng' => $geoJsonData["features"][0]["geometry"]["coordinates"][0][0][0] ?? null,
]);
Log::debug('GeoJSON imported successfully:' . json_encode($get('location')));
$livewire->dispatch('refreshMap');Instead, only the position of the view (based on lat and lng) actually changes.
Note
If I refresh the page after saving the data to the database everything works as expected and I get to see the polygons.
Cause
This behaviour is most probably due to the refreshMap method only triggering the marker and position updates:
filament-map-picker/resources/js/index.js
Lines 529 to 532 in 0946499
| refreshMap: function() { | |
| this.map.flyTo(this.getCoordinates()); | |
| this.updateMarker(); | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels