/** * Renders the markers for the map. * * @param Map $map The map * @return string The html */ protected function renderMarkers(Map $map) { $html = ''; foreach ($map->getMarkers() as $marker) { $html .= sprintf('var %s = new L.Marker(new L.LatLng(%s, %s)); %s.addLayer(%s);', $marker->getVarName(), $marker->getCoordinate()->getLat(), $marker->getCoordinate()->getLng(), $map->getVarName(), $marker->getVarName()); if ($map->getAutoZoom()) { $html .= sprintf('%s.extend(%s.getLatLng());', $this->getBoundsVarName($map), $marker->getVarName()); } } return $html; }
/** * Renders the markers for the map. * * @param Map $map The map * @return string The html */ protected function renderMarkers(Map $map) { $html = ''; foreach ($map->getMarkers() as $marker) { $html .= sprintf('var %s = new google.maps.Marker({ position: new google.maps.LatLng(%s, %s), map: %s });', $marker->getVarName(), $marker->getCoordinate()->getLat(), $marker->getCoordinate()->getLng(), $map->getVarName()); if ($map->getAutoZoom()) { $html .= sprintf('%s.extend(new google.maps.LatLng(%s, %s));', $this->getBoundsVarName($map), $marker->getCoordinate()->getLat(), $marker->getCoordinate()->getLng()); } } return $html; }
/** * Renders the maps markers. * * @param Map $map The map * @return string The html */ protected function renderMarkers(Map $map) { $html = ''; foreach ($map->getMarkers() as $marker) { $html .= sprintf('%s.entities.push(new Microsoft.Maps.Pushpin(new Microsoft.Maps.Location(%s, %s)));', $map->getVarName(), $marker->getCoordinate()->getLat(), $marker->getCoordinate()->getLng()); $html .= sprintf('%s.push(new Microsoft.Maps.Location(%s, %s));', $this->getMapPinsVarName($map), $marker->getCoordinate()->getLat(), $marker->getCoordinate()->getLng()); } return $html; }