コード例 #1
0
 public function testRenderMapWithEnabledMapControls()
 {
     $map = new Map();
     $map->setJavascriptVariable('map');
     $map->setMapTypeControl(array(MapTypeId::TERRAIN), ControlPosition::BOTTOM_CENTER, MapTypeControlStyle::HORIZONTAL_BAR);
     // FIXME Add all map controls...
     $expected = 'map = new google.maps.Map(' . 'document.getElementById("map_canvas"), ' . '{' . '"mapTypeId":google.maps.MapTypeId.ROADMAP,' . '"mapTypeControl":true,' . '"mapTypeControlOptions":' . '{' . '"mapTypeIds":[google.maps.MapTypeId.TERRAIN],' . '"position":google.maps.ControlPosition.BOTTOM_CENTER,' . '"style":google.maps.MapTypeControlStyle.HORIZONTAL_BAR' . '},' . '"zoom":3' . '});' . PHP_EOL;
     $this->assertSame($expected, $this->mapHelper->renderMap($map));
 }
コード例 #2
0
 /**
  * @expectedException \Ivory\GoogleMap\Exception\MapException
  * @expectedExceptionMessage The map type control setter arguments is invalid.
  * The available prototypes are :
  * - function setMapTypeControl(Ivory\GoogleMap\Controls\MapTypeControl $mapTypeControl = null)
  * - function setMaptypeControl(array $mapTypeIds, string $controlPosition, string $mapTypeControlStyle)
  */
 public function testMapTypeControlWithInvalidValue()
 {
     $this->map->setMapTypeControl('foo');
 }