From f6a9b9dce20ada6158e82484ae23f26859d4410a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ll?= Date: Thu, 14 Jul 2016 10:09:36 +0200 Subject: [PATCH] Version 2.13 Remove support for MapQuest tile server --- CHANGES | 3 +++ helper.php | 8 +++----- mod_osmod.script.php | 1 + mod_osmod.xml | 5 ++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index 48037ea..7cd6de0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ OSModul Changelog ----------------- +v2.13 + - Remove MapQuest tile server, since they blocked free access to their tile servers + v2.12 - Fix root dir for asserts diff --git a/helper.php b/helper.php index 597e90e..885ac17 100644 --- a/helper.php +++ b/helper.php @@ -20,7 +20,6 @@ private static function imagery($bl, $style){ $return = ""; if($bl == 'mapnikde') $return = 'Openstreetmap.de (CC-BY-SA)'; else if($bl == 'stamenwater') $return = 'Stamen Design, CC BY 3.0'; - else if($bl == 'mapquest') $return = 'MapQuest'; else if($bl == 'opentopomap') $return = 'OpenTopoMap (CC-BY-SA), SRTM'; else if($bl == 'openmapsurfer') $return = 'GIScience Research Group @ University of Heidelberg'; else if($bl == 'humanitarian') $return = 'Humanitarian OpenStreetMap Team'; @@ -155,14 +154,13 @@ private static function mpPins($parPins, $id){ public static function javascript($params, $id){ // load baselayerURL $baselayerSettings = ''; - 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, "; } + 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', ''); } + else /* unknown layer and mapnik */ { $baselayerURL = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; $baselayerSettings = "maxZoom: 19, "; } // load start coordinates $lat = $params->get('lat', 50.560715); @@ -218,7 +216,7 @@ public static function javascript($params, $id){ if ($params->get('attrLeaflet', 1) == 1) { $js .= "map".$id.".attributionControl.addAttribution('Powered by Leaflet');\n"; } - if ($params->get('attrImagery', 1) == 1 && $params->get('baselayer', 'mapnik') != 'mapnik') { + if ($params->get('attrImagery', 1) == 1 && self::imagery($params->get('baselayer', 'mapnik'), $params->get('customBaselayer', "")) != '') { $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) { diff --git a/mod_osmod.script.php b/mod_osmod.script.php index 6c2a897..f91986e 100644 --- a/mod_osmod.script.php +++ b/mod_osmod.script.php @@ -37,6 +37,7 @@ function uninstall($parent) { function update($parent) { // $parent is the class calling this method echo '

' . JText::sprintf('MOD_OSMOD_UPDATE', $parent->get('manifest')->version) . '

'; + echo '

Please note, the support for MapQuest has been dropped.

'; } // Before install/update/uninstall diff --git a/mod_osmod.xml b/mod_osmod.xml index 166ffb1..73e6a27 100644 --- a/mod_osmod.xml +++ b/mod_osmod.xml @@ -4,12 +4,12 @@ OSModul Martin Kröll - 13.06.2016 + 14.07.2016 (c) 2012-2016 Martin Kröll https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL technikschlumpf@web.de https://extensions.joomla.org/extensions/owner/schlumpf - 2.12 + 2.13 MOD_OSMOD_DESCRIPTION @@ -70,7 +70,6 @@ -