Example #1
0
 public function testEncodedPolylineWithoutAutoZoom()
 {
     $encodedPolyline = $this->getMock('Ivory\\GoogleMap\\Overlays\\EncodedPolyline');
     $this->setUpBound();
     $this->map->getBound()->expects($this->never())->method('extend');
     $this->map->addEncodedPolyline($encodedPolyline);
     $this->assertSame(array($encodedPolyline), $this->map->getEncodedPolylines());
 }
 /**
  * Gets the libraries needed for the map.
  *
  * @param \Ivory\GoogleMap\Map $map The map.
  *
  * @return array The map libraries.
  */
 protected function getLibraries(Map $map)
 {
     $libraries = $map->getLibraries();
     $encodedPolylines = $map->getEncodedPolylines();
     if (!empty($encodedPolylines)) {
         $libraries[] = 'geometry';
     }
     return array_unique($libraries);
 }
Example #3
0
 /**
  * Renders the javascript container encoded polylines.
  *
  * @param \Ivory\GoogleMap\Map $map The map.
  *
  * @return string The JS output.
  */
 public function renderJsContainerEncodedPolylines(Map $map)
 {
     $output = array();
     foreach ($map->getEncodedPolylines() as $encodedPolyline) {
         $output[] = sprintf('%s.encoded_polylines.%s = %s', $this->getJsContainerName($map), $encodedPolyline->getJavascriptVariable(), $this->encodedPolylineHelper->render($encodedPolyline, $map));
     }
     return implode('', $output);
 }