How can I style an object in a array
in controller
Laravel?
Mapper::marker($marker['lat'],
$marker['lng'],['label'=> "<div>".$marker['label']."</div>"]);
Controller
public function index(){
Mapper::map(-22.886449, -43.118474,
[ 'marker'=>false,
'zoom' => 10,
'draggable' => true,
'center' => true,
'cluster' => false,
'markers' => [
'eventBeforeLoad' => 'addMapStyling(map);',
'icon' =>'img/ida_22.png',
'title' => '166001',
'animation' => 'DROP'],
]);
$markers = array(['lat' => -22.886449,'lng' => -43.118474,'label'=> 'Veículo 01'],
['lat' => -22.885632,'lng' => -43.118143,'label'=> 'Veículo 02'],
['lat' => -22.883990,'lng' => -43.119513,'label'=> 'Veículo 03'],
['lat' => -22.885734,'lng' => -43.124988,'label'=> 'Veículo 04']);
foreach ($markers as $marker) {
//dd($marker['label']);
Mapper::marker($marker['lat'], $marker['lng'],
['label'=> $marker['label']]);
Mapper::informationWindow($marker['lat'], $marker['lng'], $marker['label']);
}
return view('rastreamento.mapa.mapa');
}
View
<div id="#map-canvas-0">
{!! Mapper::render() !!}
</div>
The package name and cornford googlmapper
Perciso that looks like this: