I have a list of addresses with a button to data-detail. Clicking the button will open the modal and show leaflet map. Centered as initiated. The address plus coordinates from the Data_Detail are show in the heading, but not on the map. No marker either.
How can I fix this?
It is at Adressen in Skuzum
It is on the page now, but no marker.
So I have 2 maps on the page now. The top one its data from data-detail and shows no markers.
The bottom one gets data from the regular server action and shows all the the markers.
On your page you have 2 data detail regions: ddadres and ddadres1. With your button you are setting the data to the ddadres1 but for the map you are using dmx-bind:markers="ddadres.data" so as no data is set for it, no pins are shown. Make sure to use the same data details for both the button that sets the data and in the map.
Ok, I totally remove the modal with the map. So now only the upper map on the page use ddadres. No more ddadres1.
The lower map still uses the basic sc.
The detail map still shows no Marker, although the address in the para above it shows the selected address from ddadres.
I see the issue. The problem is that the leaflet map expects an array and the data detail does not return an array but a single item object. You need to use the server action there directly and filter it instead.