Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ability to specify a different tile url #3472

Merged
merged 1 commit into from
May 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/Extensions/Globe-Frontpage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion html/includes/common/worldmap.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
}
$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);

Expand Down
3 changes: 2 additions & 1 deletion includes/defaults.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,8 @@ function set_debug($debug) {
$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
Expand Down