mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-25 18:03:15 +00:00
OSM improvements - increase zoom, return quickly if no location to render
This commit is contained in:
parent
a7d5bdfc9a
commit
111f6717a8
2 changed files with 4 additions and 1 deletions
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 a new issue