Map is moved to the new place

This commit is contained in:
Michael 2017-12-13 21:37:34 +00:00
parent 9d574f6666
commit ea10a7c002
5 changed files with 10 additions and 10 deletions

View File

@ -6,10 +6,10 @@ use Friendica\Core\Cache;
use Friendica\Core\System;
use Friendica\Core\Config;
use Friendica\Model\Contact;
use Friendica\Util\Map;
require_once 'include/oembed.php';
require_once 'include/event.php';
require_once 'include/map.php';
require_once 'mod/proxy.php';
require_once 'include/plaintext.php';
@ -33,11 +33,11 @@ function bb_PictureCache($matches) {
function bb_map_coords($match) {
// the extra space in the following line is intentional
return str_replace($match[0], '<div class="map" >' . generate_map(str_replace('/', ' ', $match[1])) . '</div>', $match[0]);
return str_replace($match[0], '<div class="map" >' . Map::byCoordinates(str_replace('/', ' ', $match[1])) . '</div>', $match[0]);
}
function bb_map_location($match) {
// the extra space in the following line is intentional
return str_replace($match[0], '<div class="map" >' . generate_named_map($match[1]) . '</div>', $match[0]);
return str_replace($match[0], '<div class="map" >' . Map::byLocation($match[1]) . '</div>', $match[0]);
}
function bb_attachment($Text, $simplehtml = false, $tryoembed = true) {

View File

@ -9,9 +9,9 @@ use Friendica\Content\Feature;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Util\Map;
require_once 'include/bbcode.php';
require_once 'include/map.php';
require_once 'include/datetime.php';
require_once "include/conversation.php";
@ -75,7 +75,7 @@ function format_event_html($ev, $simple = false) {
// Include a map of the location if the [map] BBCode is used.
if (strpos($ev['location'], "[map") !== false) {
$map = generate_named_map($ev['location']);
$map = Map::byLocation($ev['location']);
if ($map !== $ev['location']) {
$o.= $map;
}
@ -967,9 +967,9 @@ function format_event_item($item) {
}
// Construct the map HTML.
if (isset($evloc['address'])) {
$location['map'] = '<div class="map">' . generate_named_map($evloc['address']) . '</div>';
$location['map'] = '<div class="map">' . Map::byLocation($evloc['address']) . '</div>';
} elseif (isset($evloc['coordinates'])) {
$location['map'] = '<div class="map">' . generate_map(str_replace('/', ' ', $evloc['coordinates'])) . '</div>';
$location['map'] = '<div class="map">' . Map::byCoordinates(str_replace('/', ' ', $evloc['coordinates'])) . '</div>';
}
// Construct the profile link (magic-auth).

View File

@ -9,9 +9,9 @@ use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Util\Map;
require_once "include/friendica_smarty.php";
require_once "include/map.php";
require_once "mod/proxy.php";
require_once "include/conversation.php";
@ -1372,7 +1372,7 @@ function prepare_body(&$item, $attach = false, $preview = false) {
// Map.
if (strpos($s, '<div class="map">') !== false && x($item, 'coord')) {
$x = generate_map(trim($item['coord']));
$x = Map::byCoordinates(trim($item['coord']));
if ($x) {
$s = preg_replace('/\<div class\=\"map\"\>/', '$0' . $x, $s);
}

View File

@ -1488,7 +1488,7 @@ function photos_content(App $a) {
}
if ($link_item['coord']) {
$map = generate_map($link_item['coord']);
$map = Map::byCoordinates($link_item['coord']);
}
}