Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #10 from Schlumpf/https
Browse files Browse the repository at this point in the history
Use https for supporting tile servers
  • Loading branch information
Schlumpf committed May 2, 2016
2 parents 9651ad1 + 4992b2d commit c17ebb6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
5 changes: 4 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
OSModul Changelog
-----------------

v2.11
- Use https for supporting tile servers

v2.10
- Include fr-FR language (Thanks to bcag2)
- Installations of old third-party FR language pack will removed
Expand Down Expand Up @@ -33,4 +36,4 @@ v2.4:
v2.3:
- Joomla 3.0 support
- Missing Icon in module settings fixed
- Leaflet updated to v0.5.1
- Leaflet updated to v0.5.1
22 changes: 11 additions & 11 deletions helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ private static function wxh($string){
private static function imagery($bl, $style){
$return = "";
if($bl == 'mapnikde') $return = '<a href="http://www.openstreetmap.de/">Openstreetmap.de</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)';
else if($bl == 'stamenwater') $return = '<a href="http://stamen.com">Stamen Design</a>, <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>';
else if($bl == 'mapquest') $return = '<a href="http://www.mapquest.com/">MapQuest</a>';
else if($bl == 'stamenwater') $return = '<a href="http://stamen.com">Stamen Design</a>, <a href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>';
else if($bl == 'mapquest') $return = '<a href="https://www.mapquest.com/">MapQuest</a>';
else if($bl == 'opentopomap') $return = '<a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>), <a href="http://viewfinderpanoramas.org">SRTM</a>';
else if($bl == 'openmapsurfer') $return = '<a href="http://giscience.uni-hd.de/">GIScience Research Group @ University of Heidelberg</a>';
else if($bl == 'humanitarian') $return = '<a href="https://hotosm.org/">Humanitarian OpenStreetMap Team</a>';
Expand Down Expand Up @@ -155,13 +155,13 @@ private static function mpPins($parPins, $id){
public static function javascript($params, $id){
// load baselayerURL
$baselayerSettings = '';
if ($params->get('baselayer', 'mapnik') == 'mapnik') { $baselayerURL = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; $baselayerSettings = "maxZoom: 19, "; }
else if($params->get('baselayer', 'mapnik') == 'mapquest') { $baselayerURL = 'http://otile{s}.mqcdn.com/tiles/1.0.0/{type}/{z}/{x}/{y}.{ext}'; $baselayerSettings = "type: 'map', ext: 'jpg', subdomains: '1234', "; }
else if($params->get('baselayer', 'mapnik') == 'mapnikde') { $baselayerURL = 'http://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png'; $baselayerSettings = "maxZoom: 18, "; }
else if($params->get('baselayer', 'mapnik') == 'stamenwater') { $baselayerURL = 'http://stamen-tiles-{s}.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png'; $baselayerSettings = "subdomains: 'abcd', minZoom: 1, maxZoom: 16, "; }
else if($params->get('baselayer', 'mapnik') == 'opentopomap') { $baselayerURL = 'http://{s}.tile.opentopomap.org/{z}/{x}/{y}.png'; $baselayerSettings = "maxZoom: 16, "; }
else if($params->get('baselayer', 'mapnik') == 'openmapsurfer') { $baselayerURL = 'http://openmapsurfer.uni-hd.de/tiles/roads/x={x}&y={y}&z={z}'; $baselayerSettings = "maxZoom: 20, "; }
else if($params->get('baselayer', 'mapnik') == 'humanitarian') { $baselayerURL = 'http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png'; $baselayerSettings = "maxZoom: 20, "; }
if ($params->get('baselayer', 'mapnik') == 'mapnik') { $baselayerURL = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; $baselayerSettings = "maxZoom: 19, "; }
else if($params->get('baselayer', 'mapnik') == 'mapquest') { $baselayerURL = 'http://otile{s}.mqcdn.com/tiles/1.0.0/{type}/{z}/{x}/{y}.{ext}'; $baselayerSettings = "type: 'map', ext: 'jpg', subdomains: '1234', "; }
else if($params->get('baselayer', 'mapnik') == 'mapnikde') { $baselayerURL = 'http://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png'; $baselayerSettings = "maxZoom: 18, "; }
else if($params->get('baselayer', 'mapnik') == 'stamenwater') { $baselayerURL = 'https://stamen-tiles-{s}.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png'; $baselayerSettings = "subdomains: 'abcd', minZoom: 1, maxZoom: 16, "; }
else if($params->get('baselayer', 'mapnik') == 'opentopomap') { $baselayerURL = 'https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png'; $baselayerSettings = "maxZoom: 16, "; }
else if($params->get('baselayer', 'mapnik') == 'openmapsurfer') { $baselayerURL = 'http://korona.geog.uni-heidelberg.de/tiles/roads/x={x}&y={y}&z={z}'; $baselayerSettings = "maxZoom: 20, "; }
else if($params->get('baselayer', 'mapnik') == 'humanitarian') { $baselayerURL = 'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png'; $baselayerSettings = "maxZoom: 20, "; }
else if($params->get('baselayer', 'mapnik') == 'custom') { $baselayerURL = $params->get('customBaselayerURL', ''); }

// load start coordinates
Expand Down Expand Up @@ -208,7 +208,7 @@ public static function javascript($params, $id){
// create the map
$js = "var map".$id." = new L.Map('map".$id."', {".$worldcopyjump."});\n";
$js .= " map".$id.".attributionControl.setPrefix('');\n";
$js .= "var baselayer".$id." = new L.TileLayer('".$baselayerURL."', {".$baselayerSettings.$nowarp."attribution: '<a href=\"http://www.openstreetmap.org/copyright\" target=\"_blank\">© OpenStreetMap contributors</a>'});\n";
$js .= "var baselayer".$id." = new L.TileLayer('".$baselayerURL."', {".$baselayerSettings.$nowarp."attribution: '<a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">© OpenStreetMap contributors</a>'});\n";
$js .= "var koord".$id." = new L.LatLng(".$lat.", ".$lon.");\n";

// Scale
Expand All @@ -222,7 +222,7 @@ public static function javascript($params, $id){
$js .= "map".$id.".attributionControl.addAttribution('".JText::_('MOD_OSMOD_IMAGERY')." ".self::imagery($params->get('baselayer', 'mapnik'), $params->get('customBaselayer', ""))."');\n";
}
if ($params->get('attrModule', 1) == 1) {
$js .= "map".$id.".attributionControl.addAttribution('".JText::_('MOD_OSMOD_MODULE_BY')." <a href=\"http://extensions.joomla.org/extensions/owner/schlumpf\" target=\"_blank\">Martin Kröll</a>');\n";
$js .= "map".$id.".attributionControl.addAttribution('".JText::_('MOD_OSMOD_MODULE_BY')." <a href=\"https://extensions.joomla.org/extensions/owner/schlumpf\" target=\"_blank\">Martin Kröll</a>');\n";
}

// Pin
Expand Down
12 changes: 6 additions & 6 deletions mod_osmod.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<!-- Metadata -->
<name>OSModul</name>
<author>Martin Kröll</author>
<creationDate>29.12.2015</creationDate>
<copyright>(c) 2012-2015 Martin Kröll</copyright>
<license>http://www.gnu.org/licenseses/gpl-3.0.html GNU/GPL</license>
<creationDate>02.05.2016</creationDate>
<copyright>(c) 2012-2016 Martin Kröll</copyright>
<license>https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL</license>
<authorEmail>[email protected]</authorEmail>
<authorUrl>http://extensions.joomla.org/extensions/owner/schlumpf</authorUrl>
<version>2.10</version>
<authorUrl>https://extensions.joomla.org/extensions/owner/schlumpf</authorUrl>
<version>2.11</version>
<description>MOD_OSMOD_DESCRIPTION</description>

<!-- Update servers -->
Expand Down Expand Up @@ -100,7 +100,7 @@
<option value="0">JNO</option>
</field>

<field type="list" name="attrModule" default="1" label="MOD_OSMOD_ATTRMODULE" description="MOD_OSMOD_ATTRMODULE_DESC">
<field type="list" name="attrModule" default="0" label="MOD_OSMOD_ATTRMODULE" description="MOD_OSMOD_ATTRMODULE_DESC">
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
Expand Down

0 comments on commit c17ebb6

Please sign in to comment.