Closed rjcalifornia closed 2 years ago
can you give some example code of what you are trying to do?
Sorry for the late reply. If I wanted to make place multiple markes on the SAME map, it won't work:
<x-maps-leaflet :markers="[
@foreach ($locations as $location)
['lat' => $location->latitude, 'long' => $location->longitude',
@endforeach
]"></x-maps-leaflet>
So it is probably a good idea to do this loop in your controller that way you can pass a single array to the component.
So it is probably a good idea to do this loop in your controller that way you can pass a single array to the component.
Well, yeah. I actually did that after the first code I posted didn't work. I didn't work, the map was blank for some reason.
Without more code / errors in the console you are getting its going to be hard for me to diagnose the problem
Alright...
I know blade tags dont have to use the {{ and }} to pass data
https://github.com/LarsWiegers/laravel-maps/issues/6
Currently, there's no way to add markers dynamically. For instance, I query the DB and get an array of coordinates. Currently you cannot loop through each location to place a marker on a single map (not multiple maps).
May be there's a way but I can't find it.