Google Maps with markers, some things not working

Wappler 5.0.2, MacBook Pro M1 Max

I have a modal window to add locations to my database using a google places auto complete address, as well as a google map underneath.
When the user starts to enter an address, and then clicks on one, it adds a marker to the map and zooms and pans to the marker.
After the form is submitted, the form resets and the modal closes.

If the user now adds a second location without a page refresh, the marker is still showing from the previous input, the zoom is still set to the marker and it is panned on it.

I have tried adding an onclick to the button which opens the modal, and using a .removeAllMarkers() binding, however it still does not remove the markers, I have tried with form reset, map .reload(), modal .refresh() etc. and none seem to be able to remove the single marker from the previous input not reset the map zoom and position.

The only luck i have had so far is getting the the map to reset the zoom and position by adding a .reload() even though that is not an available binding in the UI, so I just need to be able to remove the marker now.

1 Like