Closed brausepulver closed 2 years ago
Hi @brausepulver, thx for creating the issue. Would be cool if you could do a pr and change the code. currently dont have time to do it. maybe next week i have time but not now.
@brausepulver I created a pr, can you check if it is what you want?
Its been 2 weeks, merging the pr.
When supplying a centerPoint array ordered
['long' => ..., 'lat' => ...]
rather than['lat' => ..., 'long' => ...]
, the coordinates are switched. This is because ofhttps://github.com/LarsWiegers/laravel-maps/blob/cd464645e89695871a5a4a06c7213280cb78d519/resources/views/components/leaflet.blade.php#L26
I suggest changing it to
var mymap = L.map('{{$mapId}}').setView([{{$centerPoint['lat'] ?? $centerPoint[0]}}, {{$centerPoint['long'] ?? $centerPoint[1]}}], {{$zoomLevel}});