2amigos / yii2-google-maps-library

Google Maps API library for Yii2
https://2amigos.us
BSD 3-Clause "New" or "Revised" License
106 stars 78 forks source link

Display the InfoWindow of all markers by default #111

Open urbannet92 opened 6 years ago

urbannet92 commented 6 years ago

Hello, how I can display the InfoWindow of all markers by default. Thank you. My code is:

$coord = new LatLng(['lat' => 48.866667, 'lng' => 2.333333]); // --------------------------------------------------- $map = new Map([ 'center' => $coord, 'zoom' => 14, ]); // Lets add a marker now $marker = new Marker([ 'position' => $coord, 'title' => 'Titre 1', ]); // Provide a shared InfoWindow to the marker $infoWin = new InfoWindow([ 'content' => '

This is title

' ]); // $infoWin->setOptions(new InfoWindowOptions(['visible'=>true])); $marker->attachInfoWindow($infoWin); $map->addOverlay($marker); // ---------------------------------------------------

$coord = new LatLng(['lat' => 48.3175245000, 'lng' => 2.0921782000]); // Lets add a marker now $marker = new Marker([ 'position' => $coord, 'title' => 'Titre 1', ]); // Provide a shared InfoWindow to the marker $infoWin = new InfoWindow([ 'content' => '

This is title

' ]); // $infoWin->setOptions(new InfoWindowOptions(['visible'=>true])); $marker->attachInfoWindow($infoWin); $map->addOverlay($marker); // ---------------------------------------------------

// Display the map -finally :) echo $map->display();

urbannet92 commented 6 years ago

Hi, for info, i see this request https://github.com/2amigos/yii2-google-maps-library/issues/35 but it's not ok, he open only a last marker. for me, i like open all markers info window. Thank''s