/** * Sets the center of the map. * * @param Map $map * @return string The html */ protected function setMapCenter(Map $map) { return sprintf('%s.setView(new L.LatLng(%s, %s), %u);', $map->getVarName(), $map->getCenter()->getLat(), $map->getCenter()->getLng(), $map->getZoom()); }
/** * Sets the center of the map. * * @param Map $map * @return string The html */ protected function setMapCenter(Map $map) { return sprintf('%s.setCenter(new google.maps.LatLng(%s, %s));', $map->getVarName(), $map->getCenter()->getLat(), $map->getCenter()->getLng()); }
/** * Renders the script to set the center of the map. * * @param Map $map The map * @return string The html */ protected function setMapCenter(Map $map) { if (null === $map->getCenter()) { return; } return sprintf('%s.setView({ center: new Microsoft.Maps.Location(%s, %s) });', $map->getVarName(), $map->getCenter()->getLat(), $map->getCenter()->getLng()); }