Could you integrate this code to have Open Topo Map in the map list? Thanks.
Add OpenTopoMap as a base layer option
Context
OpenTopoMap is a free topographic map layer based on OpenStreetMap data and SRTM elevation data. It is particularly useful for galleries featuring hiking, mountain, or nature photography. The tile URL is stable and the service is free with no API key required.
File 1: admin/admin_config.php
Add 'opentopomap' to the $available_baselayer array:
$available_baselayer = array(
...
'esri' => 'Esri.WorldImagery',
'opentopomap' => 'OpenTopoMap', // <-- add this line
'custom' => 'Own tile (custom style)',
);
File 2: include/functions_map.php
Change 1 — osmcopyright() function: Add the legal attribution required by OpenTopoMap's terms of use:
// Add after the 'esri' line:
else if($bl == 'opentopomap') $return .= 'Map data: © OpenStreetMap contributors, SRTM | Map style: © OpenTopoMap (CC-BY-SA)';
Change 2 — Tile URL loading: Add the tile server URL, using the existing $httpx variable for HTTP/HTTPS support:
// Add after the 'esri' line:
else if($baselayer == 'opentopomap') $baselayerurl = $httpx.'://{s}.tile.opentopomap.org/{z}/{x}/{y}.png';
Notes
No API key required.
The tile URL uses {s} subdomains (a, b, c) for load balancing, as recommended by OpenTopoMap.
OpenTopoMap supports up to zoom level 17, which is compatible with the plugin's current maxZoom: 16 setting.
Attribution text is compliant with the CC-BY-SA license requirements.
Could you integrate this code to have Open Topo Map in the map list? Thanks.
Add OpenTopoMap as a base layer option
Context
OpenTopoMap is a free topographic map layer based on OpenStreetMap data and SRTM elevation data. It is particularly useful for galleries featuring hiking, mountain, or nature photography. The tile URL is stable and the service is free with no API key required.
File 1: admin/admin_config.php
Add 'opentopomap' to the $available_baselayer array:
$available_baselayer = array(
...
'esri' => 'Esri.WorldImagery',
'opentopomap' => 'OpenTopoMap', // <-- add this line
'custom' => 'Own tile (custom style)',
);
File 2: include/functions_map.php
Change 1 — osmcopyright() function: Add the legal attribution required by OpenTopoMap's terms of use:
// Add after the 'esri' line:
else if($bl == 'opentopomap') $return .= 'Map data: © OpenStreetMap contributors, SRTM | Map style: © OpenTopoMap (CC-BY-SA)';
Change 2 — Tile URL loading: Add the tile server URL, using the existing $httpx variable for HTTP/HTTPS support:
// Add after the 'esri' line:
else if($baselayer == 'opentopomap') $baselayerurl = $httpx.'://{s}.tile.opentopomap.org/{z}/{x}/{y}.png';
Notes
No API key required.
The tile URL uses {s} subdomains (a, b, c) for load balancing, as recommended by OpenTopoMap.
OpenTopoMap supports up to zoom level 17, which is compatible with the plugin's current maxZoom: 16 setting.
Attribution text is compliant with the CC-BY-SA license requirements.