egeloen / IvoryGoogleMapBundle

Google Map API v3 integration for your Symfony2 project.
https://github.com/egeloen/ivory-google-map
MIT License
217 stars 152 forks source link

Drawing a path #131

Closed ricardoalmira89 closed 8 years ago

ricardoalmira89 commented 9 years ago

hi guys. I need to draw a path between two coordinates. I did this:

foreach ($response->getRoutes() as $route) { foreach ($route->getLegs() as $leg) { foreach ($leg->getSteps() as $step) { $instructions->add($step->getInstructions()); $polyline->addCoordinate($step->getStartLocation()->getLatitude(), $step->getStartLocation()->getLongitude(),true); } } } $map->addPolyline($polyline);

but isn´t enough. This code draws rect lines and i need to draw them inside the roads, like a really path. I´ve been reading the documentation inside the bundle and it seems that a good way to make it work is with DirectionStep, using getEncodedPolyline getter. I tried $map->addEncodedPolyline($encodedP) but the map dont render the polyline. Thanks.

egeloen commented 9 years ago

That's strange the encoded polyline does not work but anyway, it will not fix your issue as the encoded polyline is just a polyline and will result to the same as you have already experienced. It is currently not supported as it is a pretty complex feature... I need to investigate in order to see what can be done.

ricardoalmira89 commented 9 years ago

in order to solve my problem, i wrote some code to use directly the google api, and it works for me. We will love this functionality into your awesome Bundle. greetings from cuba.

2014-11-29 0:39 GMT+01:00, Eric GELOEN notifications@github.com:

That's strange the encoded polyline does not work but anyway, it will not fix your issue as the encoded polyline is just a polyline and will result to the same as you have already experienced. It is currently not supported as it is a pretty complex feature... I need to investigate in order to see what can be done.


Reply to this email directly or view it on GitHub: https://github.com/egeloen/IvoryGoogleMapBundle/issues/131#issuecomment-64934804

egeloen commented 8 years ago

Your issue has been fixed in #159 (encoded polyline works again) but will only be part of the 3.x version of the bundle.