예제 #1
0
 /**
  * Creates a marker cluster.
  */
 public function __construct()
 {
     parent::__construct();
     $this->setPrefixJavascriptVariable('marker_cluster_');
     $this->setType(self::_DEFAULT);
     $this->markers = array();
 }
예제 #2
0
 /**
  * Creates a KML Layer.
  *
  * @param string $url The KML layer url.
  */
 public function __construct($url = null)
 {
     parent::__construct();
     $this->setPrefixJavascriptVariable('kml_layer_');
     if ($url !== null) {
         $this->setUrl($url);
     }
 }
 /**
  * Creates an encoded polyline.
  *
  * @param string $value The encoded polyline value.
  */
 public function __construct($value = null)
 {
     parent::__construct();
     $this->setPrefixJavascriptVariable('encoded_polyline_');
     if ($value !== null) {
         $this->setValue($value);
     }
 }
예제 #4
0
 /**
  * Creates a rectangle.
  */
 public function __construct(Bound $bound = null)
 {
     parent::__construct();
     $this->setPrefixJavascriptVariable('rectangle_');
     if ($bound === null) {
         $bound = new Bound(new Coordinate(-1, -1), new Coordinate(1, 1));
     }
     $this->setBound($bound);
 }
예제 #5
0
 /**
  * Create a circle.
  *
  * @param \Ivory\GoogleMap\Base\Coordinate $center The circle center.
  * @param double                           $radius The circle radius.
  */
 public function __construct(Coordinate $center = null, $radius = 1)
 {
     parent::__construct();
     $this->setPrefixJavascriptVariable('circle_');
     if ($center === null) {
         $center = new Coordinate();
     }
     $this->setCenter($center);
     $this->setRadius($radius);
 }
예제 #6
0
 /**
  * Creates a ground overlay.
  *
  * @param string                      $url   The ground overlay url.
  * @param \Ivory\GoogleMap\Base\Bound $bound The ground overlay bound.
  */
 public function __construct($url = null, Bound $bound = null)
 {
     parent::__construct();
     $this->setPrefixJavascriptVariable('ground_overlay_');
     if ($url !== null) {
         $this->setUrl($url);
     }
     if ($bound === null) {
         $bound = new Bound(new Coordinate(-1, -1), new Coordinate(1, 1));
     }
     $this->setBound($bound);
 }
예제 #7
0
 /**
  * Creates an info window.
  *
  * @param string                           $content     The info window content.
  * @param \Ivory\GoogleMap\Base\Coordinate $position    The info window position.
  * @param \Ivory\GoogleMap\Base\Size       $pixelOffset The info window pixel offset.
  * @param boolean                          $open        The info window open flag.
  * @param string                           $openEvent   The info window open event.
  * @param boolean                          $autoOpen    The info window auto open flag.
  * @param boolean                          $autoClose   The info window auto close flag
  */
 public function __construct($content = '<p>Default content</p>', Coordinate $position = null, Size $pixelOffset = null, $open = false, $openEvent = MouseEvent::CLICK, $autoOpen = true, $autoClose = false)
 {
     parent::__construct();
     $this->setPrefixJavascriptVariable('info_window_');
     $this->setContent($content);
     if ($position !== null) {
         $this->setPosition($position);
     }
     if ($pixelOffset !== null) {
         $this->setPixelOffset($pixelOffset);
     }
     $this->setOpen($open);
     $this->setOpenEvent($openEvent);
     $this->setAutoOpen($autoOpen);
     $this->setAutoClose($autoClose);
 }
예제 #8
0
 /**
  * Creates a marker.
  *
  * @param \Ivory\GoogleMap\Base\Coordinate      $position   The marker position.
  * @param string                                $animation  The marker animation.
  * @param \Ivory\GoogleMap\Overlays\MarkerImage $icon       The marker icon.
  * @param \Ivory\GoogleMap\Overlays\MarkerImage $shadow     The marker shadow.
  * @param \Ivory\GoogleMap\Overlays\MarkerShape $shape      The marker shape.
  * @param \Ivory\GoogleMap\Overlays\InfoWindow  $infoWindow The marker info window.
  */
 public function __construct(Coordinate $position = null, $animation = null, MarkerImage $icon = null, MarkerImage $shadow = null, MarkerShape $shape = null, InfoWindow $infoWindow = null)
 {
     parent::__construct();
     $this->setPrefixJavascriptVariable('marker_');
     if ($position === null) {
         $position = new Coordinate();
     }
     $this->setPosition($position);
     if ($animation !== null) {
         $this->setAnimation($animation);
     }
     if ($icon !== null) {
         $this->setIcon($icon);
     }
     if ($shadow !== null) {
         $this->setShadow($shadow);
     }
     if ($shape !== null) {
         $this->setShape($shape);
     }
     if ($infoWindow !== null) {
         $this->setInfoWindow($infoWindow);
     }
 }
예제 #9
0
 /**
  * Creates a polyline.
  *
  * @param array $coordinates The polyline coordinates.
  */
 public function __construct(array $coordinates = array())
 {
     parent::__construct();
     $this->setPrefixJavascriptVariable('polyline_');
     $this->setCoordinates($coordinates);
 }
 /**
  * @expectedException \Ivory\GoogleMap\Exception\AssetException
  * @expectedExceptionMessage The option "foo" does not exist.
  */
 public function testRemoveOptionWithInvalidOption()
 {
     $this->asset->removeOption('foo');
 }