Added ability to specify a different tile url

This commit is contained in:
laf
2016-05-02 19:59:45 +00:00
parent c32e300587
commit 624fbede32
3 changed files with 8 additions and 2 deletions

View File

@@ -35,6 +35,11 @@ $config['leaflet']['default_lng'] = "-3.401402";
$config['leaflet']['default_zoom'] = 8;
```
If you can't access OpenStreet map directly you can run a local [tile server](http://wiki.openstreetmap.org/wiki/Tile_servers). To specify a different url you can set:
```php
$config['leaflet']['tile_url'] = 'localhost.com';
```
### Jquery-Mapael config
Further custom options are available to load different maps of the world, set default coordinates of where the map will zoom and the zoom level by default. An example of

View File

@@ -131,7 +131,7 @@ if ($config['map']['engine'] == 'leaflet') {
}
$map_init = "[" . $init_lat . ", " . $init_lng . "], " . sprintf("%01.0f", $init_zoom);
$temp_output .= 'var map = L.map(\'leaflet-map\').setView('.$map_init.');
L.tileLayer(\'//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\', {
L.tileLayer(\'//'.$config['leaflet']['tile_url'].'/{z}/{x}/{y}.png\', {
attribution: \'&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors\'
}).addTo(map);

View File

@@ -844,7 +844,8 @@ $config['map']['engine'] = 'leaflet';
$config['mapael']['default_map'] = 'maps/world_countries.js';
$config['leaflet']['default_lat'] = '51.4800';
$config['leaflet']['default_lng'] = '0';
$config['leaflet']['default_zoom'] = 2;
$config['leaflet']['default_zoom'] = 2;
$config['leaflet']['tile_url'] = "{s}.tile.openstreetmap.org";
// General GUI options
$config['gui']['network-map']['style'] = 'new';//old is also valid