Mapping should be complete

This commit is contained in:
laf
2015-07-20 15:59:44 +01:00
parent 31ee67fbf9
commit fbec75a265
21 changed files with 310 additions and 2 deletions
+9
View File
@@ -732,3 +732,12 @@ $config['unix-agent-connection-time-out'] = 10;
// seconds
$config['unix-agent-read-time-out'] = 10;
// seconds
// Lat / Lon support for maps
$config['geoloc']['latlng'] = false; // True to enable translation of location to latlng co-ordinates
$config['geoloc']['engine'] = 'google';
$config['map']['engine'] = 'leaflet';
$config['mapael']['default_map'] = 'maps/world_countries.js';
$config['leaflet']['default_lat'] = '50.898482';
$config['leaflet']['default_lng'] = '-3.401402';
$config['leaflet']['default_zoom'] = 2;
+2 -2
View File
@@ -427,7 +427,7 @@ function location_to_latlng($device) {
$bad_loc = false;
$device_location = $device['location'];
if (!empty($device_location)) {
$device_location = preg_replace("/ /","+",$device_location);
$new_device_location = preg_replace("/ /","+",$device_location);
// We have a location string for the device.
$loc = dbFetchRow("SELECT `lat`,`lng` FROM `coordinates` WHERE `location`=? LIMIT 1", array($device_location));
if (is_array($loc) === false) {
@@ -436,7 +436,7 @@ function location_to_latlng($device) {
case "google":
default:
d_echo("Google geocode engine being used\n");
$api_url = "https://maps.googleapis.com/maps/api/geocode/json?address=$device_location";
$api_url = "https://maps.googleapis.com/maps/api/geocode/json?address=$new_device_location";
break;
}
$curl_init = curl_init($api_url);