egeloen / ivory-google-map

Google Map API v3 integration for PHP 5.6+.
MIT License
325 stars 185 forks source link

Multiple polylines on the same map fail #283

Open r-s-v-p opened 6 years ago

r-s-v-p commented 6 years ago

Hi. I'm currently on Laravel 5.4 and need your urgent advise, 'cause all my effords to make a $map->getOverlayManager()->addPolyline($polyline); or $map->getOverlayManager()->addPolylines([$polyline1, $polyline2]); is ended with light-grey screen in place of map. Currently I was able to display only 1 polyline.

r-s-v-p commented 6 years ago

a little bit of what i've tried just for a test:

$coords[] = new Coordinate(50.45, 30.623333); $coords[] = new Coordinate(50.45, 30.723333); $coords[] = new Coordinate(50.45, 30.823333);

$polyline1 = new Polyline($coords, [new IconSequence(new Symbol(SymbolPath::CIRCLE))], ['fillOpacity' => 0.5]);

$map->getOverlayManager()->addPolyline($polyline1);

unset($coords);

$coords[] = new Coordinate(50.55, 30.523333); $coords[] = new Coordinate(50.65, 30.523333); $coords[] = new Coordinate(50.75, 30.523333); $coords[] = new Coordinate(50.75, 30.623333); $coords[] = new Coordinate(50.75, 30.723333);

$polyline2 = new Polyline($coords, [new IconSequence(new Symbol(SymbolPath::CIRCLE))], ['fillOpacity' => 0.5]);

// AND $map->getOverlayManager()->addPolyline($polyline1); $map->getOverlayManager()->addPolyline($polyline2); // OR $map->getOverlayManager()->addPolylines([$polyline1, $polyline2]);

// Both of variants resulted in grey screen