OSM improvements - increase zoom, return quickly if no location to render

This commit is contained in:
friendica 2012-02-09 19:53:56 -08:00
parent a7d5bdfc9a
commit 111f6717a8
2 changed files with 4 additions and 1 deletions

Binary file not shown.

View File

@ -28,6 +28,9 @@ function openstreetmap_uninstall() {
function openstreetmap_location($a, &$item) { function openstreetmap_location($a, &$item) {
if(! (strlen($item['location']) || strlen($item['coord'])))
return;
$location = ''; $location = '';
$coord = ''; $coord = '';
@ -36,7 +39,7 @@ function openstreetmap_location($a, &$item) {
if($item['coord']) { if($item['coord']) {
$coords = explode(' ', $item['coord']); $coords = explode(' ', $item['coord']);
if(count($coords) > 1) { if(count($coords) > 1) {
$coord = '<a target="map" title="' . $item['coord'] . '" href="http://www.openstreetmap.org/?lat=' . urlencode($coords[0]) . '&lon=' . urlencode($coords[1]) . '&zoom=10">' . $item['coord'] . '</a>' ; $coord = '<a target="map" title="' . $item['coord'] . '" href="http://www.openstreetmap.org/?lat=' . urlencode($coords[0]) . '&lon=' . urlencode($coords[1]) . '&zoom=18">' . $item['coord'] . '</a>' ;
} }
} }
if(strlen($coord)) { if(strlen($coord)) {