Esempio n. 1
0
 /**
  * Render map
  *
  * @param Map $map
  *
  * @return mixed
  */
 public function renderMap(Map $map) : array
 {
     $mapHelper = new MapHelper();
     $jsMap = $mapHelper->renderJsLibraries($map);
     $jsMap = $this->removeJsCaller($jsMap);
     $jsMap .= '<script type="text/javascript"> function load_ivory_google_map(){' . $mapHelper->renderJsContainer($map) . '}</script>';
     return ['html' => $mapHelper->renderHtmlContainer($map) . $mapHelper->renderStylesheets($map), 'js' => $jsMap];
 }
 public function testRenderHtmlContainer()
 {
     $map = new Map();
     $map->setHtmlContainerId('html_container_id');
     $this->assertSame('<div id="html_container_id" style="width:300px;height:300px;"></div>' . PHP_EOL, $this->mapHelper->renderHtmlContainer($map));
 }
 /**
  * Renders the google map html container.
  *
  * @param \Ivory\GoogleMap\Map $map The map.
  *
  * @return string The html output.
  */
 public function renderHtmlContainer(Map $map)
 {
     return $this->mapHelper->renderHtmlContainer($map);
 }