Esempio n. 1
0
 public function testDefaultState()
 {
     $this->assertSame('map_canvas', $this->map->getHtmlContainerId());
     $this->assertFalse($this->map->isAsync());
     $this->assertFalse($this->map->isAutoZoom());
     $this->assertSame($this->map->getCenter()->getLatitude(), 0);
     $this->assertSame($this->map->getCenter()->getLongitude(), 0);
     $this->assertTrue($this->map->getCenter()->isNoWrap());
     $this->assertNull($this->map->getBound()->getNorthEast());
     $this->assertNull($this->map->getBound()->getSouthWest());
     $this->assertEmpty($this->map->getBound()->getExtends());
     $this->assertSame(array('mapTypeId' => 'roadmap', 'zoom' => 3), $this->map->getMapOptions());
     $this->assertSame(array('width' => '300px', 'height' => '300px'), $this->map->getStylesheetOptions());
     $this->assertFalse($this->map->hasMapTypeControl());
     $this->assertFalse($this->map->hasOverviewMapControl());
     $this->assertFalse($this->map->hasPanControl());
     $this->assertFalse($this->map->hasRotateControl());
     $this->assertFalse($this->map->hasScaleControl());
     $this->assertFalse($this->map->hasStreetViewControl());
     $this->assertFalse($this->map->hasZoomControl());
     $this->assertInstanceOf('Ivory\\GoogleMap\\Events\\EventManager', $this->map->getEventManager());
     $this->assertInstanceOf('Ivory\\GoogleMap\\Overlays\\MarkerCluster', $this->map->getMarkerCluster());
     $this->assertEmpty($this->map->getMarkers());
     $this->assertEmpty($this->map->getInfoWindows());
     $this->assertEmpty($this->map->getPolylines());
     $this->assertEmpty($this->map->getPolygons());
     $this->assertEmpty($this->map->getEncodedPolylines());
     $this->assertEmpty($this->map->getRectangles());
     $this->assertEmpty($this->map->getCircles());
     $this->assertEmpty($this->map->getGroundOverlays());
     $this->assertEmpty($this->map->getKMLLayers());
     $this->assertFalse($this->map->hasLibraries());
     $this->assertSame('en', $this->map->getLanguage());
 }
Esempio n. 2
0
 /**
  * Renders the html map stylesheets.
  *
  * @param \Ivory\GoogleMap\Map $map The map.
  *
  * @return string The HTML output.
  */
 public function renderStylesheets(Map $map)
 {
     $html = array();
     $html[] = '<style type="text/css" scoped>' . PHP_EOL;
     $html[] = '#' . $map->getHtmlContainerId() . '{' . PHP_EOL;
     foreach ($map->getStylesheetOptions() as $option => $value) {
         $html[] = $option . ':' . $value . ';' . PHP_EOL;
     }
     $html[] = '}' . PHP_EOL;
     $html[] = '</style>' . PHP_EOL;
     return implode('', $html);
 }