symfony - Google maps directions with IvoryGoogleMapsBundle -
within application manage let user pick 2 cities using autocomplete feature, , put markers on google map embed on page. part works great. dwar driving route between 2 markers, , understood have use directions. there main issue: directions uses curlhttpadapter: widow instead of geocoder. 2 cannot used in same controller, clueless on how proceed.
well found solution, adding line:
$directions = $this->get('ivory_google_map.directions');
then can use
$temp = $directions->route($from, $to); $routes = $temp->getroutes(); foreach ($routes $route) { $overviewpolyline = $route->getoverviewpolyline(); $map->addencodedpolyline($overviewpolyline); }
my issue works when render page, not when in form use ajax refresh map, question suppose.
Comments
Post a Comment