OSM improvements - increase zoom, return quickly if no location to render
parent
a7d5bdfc9a
commit
111f6717a8
Binary file not shown.
|
@ -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)) {
|
||||||
|
|
Loading…
Reference in New Issue