Skip to content

Commit

Permalink
bind icon if set (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsWiegers authored Jul 24, 2023
1 parent 78916e0 commit 10fb643
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion resources/views/components/leaflet.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ class='{{ $attributes["class"] }}'
iconSize: [{{$marker['iconSizeX'] ?? 32}} , {{ $marker['iconSizeY'] ?? 32 }}],
});
@endif
var marker = L.marker([{{$marker['lat'] ?? $marker[0]}}, {{$marker['long'] ?? $marker[1]}}]);
var marker = L.marker([{{$marker['lat'] ?? $marker[0]}}, {{$marker['long'] ?? $marker[1]}}]
@if(isset($marker['icon']))
, {icon: icon}
@endif
);
marker.addTo(mymap);
@if(isset($marker['info']))
marker.bindPopup(@json($marker['info']));
Expand Down

0 comments on commit 10fb643

Please sign in to comment.