Skip to content

Commit d54c3a4

Browse files
committed
Add MapQuest API, Add Esri.WorldImagery, Remove cloudmap #113
1 parent 9695269 commit d54c3a4

4 files changed

Lines changed: 26 additions & 8 deletions

File tree

admin/admin_config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@
4444
'mapnikhot' => 'OpenStreetMap HOT',
4545
'mapquest' => 'MapQuestOpen',
4646
'mapquestaerial'=> 'MapQuestOpen Aerial',
47-
'cloudmade' => 'Cloudmade',
4847
'toner' => 'Stamen Toner',
4948
'custom' => 'Own tile (custom style)',
49+
'esri' => 'Esri.WorldImagery',
5050
);
5151

5252
// Available zoom value

admin/admin_config.tpl

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ Refer to the <a href="https://github.com/xbgmsharp/piwigo-openstreetmap/wiki" ta
216216
<small>Check out <a href="http://leaflet-extras.github.io/leaflet-providers/preview/" target="_blank">this example</a> with half a hundred different layers to choose from.</small>
217217
</li>
218218
<div id="custom-tile-toggle" style="visibility:hidden; width:0px; height:0px; display:none;">
219+
<fieldset>
219220
<li>
220221
<label>{'CUSTOMBASELAYER'|@translate} : </label>
221222
<input type="text" value="{$map.custombaselayer}" name="osm_custombaselayer" id="osm_custombaselayer" size="40"/>
@@ -226,6 +227,16 @@ Refer to the <a href="https://github.com/xbgmsharp/piwigo-openstreetmap/wiki" ta
226227
<input type="text" value="{$map.custombaselayerurl}" name="osm_custombaselayerurl" id="osm_custombaselayerurl" onchange="tile_toggle(this)" size="40"/>
227228
<br/><small>{'CUSTOMBASELAYERURL_DESC'|@translate}</small>
228229
</li>
230+
</fieldset>
231+
</div>
232+
<div id="mapquest-tile-toggle" style="visibility:hidden; width:0px; height:0px; display:none;">
233+
<fieldset>
234+
<li>
235+
<label>{'MAPQUEST_APIKEY'|@translate} : </label>
236+
<input type="text" value="{$map.mapquest_apikey}" name="osm_mapquest_apikey" id="osm_mapquest_apikey" size="40"/>
237+
<br/><small>{'MAPQUEST_APIKEY_DESC'|@translate} Check out <a href="http://www.mapquestapi.com/" target="_blank">MapQuest API</a></small>
238+
</li>
239+
</fieldset>
229240
</div>
230241
<li>
231242
<label>{'NOWORLDWARP'|@translate} : </label>
@@ -309,14 +320,21 @@ Refer to the <a href="https://github.com/xbgmsharp/piwigo-openstreetmap/wiki" ta
309320
<script type="text/javascript">
310321
function tile_toggle()
311322
{
312-
var div = document.getElementById("custom-tile-toggle");
323+
var div_custom = document.getElementById("custom-tile-toggle");
324+
var div_mapquest = document.getElementById("mapquest-tile-toggle");
313325
var select = document.getElementById("osm_baselayer").value;
314326
//alert(select.selectedIndex);
315327
if (select == "custom") // If custom
316328
{
317-
div.removeAttribute("style");
329+
div_custom.removeAttribute("style");
330+
div_mapquest.setAttribute("style","visibility:hidden; width:0px; height:0px; display:none;");
331+
} else if (select.startsWith("mapquest")) // If mapquest
332+
{
333+
div_mapquest.removeAttribute("style");
334+
div_custom.setAttribute("style","visibility:hidden; width:0px; height:0px; display:none;");
318335
} else {
319-
div.setAttribute("style","visibility:hidden; width:0px; height:0px; display:none;");
336+
div_custom.setAttribute("style","visibility:hidden; width:0px; height:0px; display:none;");
337+
div_mapquest.setAttribute("style","visibility:hidden; width:0px; height:0px; display:none;");
320338
}
321339
tile_preview();
322340
}
@@ -367,9 +385,9 @@ function tile_preview()
367385
'{/literal}{$OSM_PATH}{literal}leaflet/icons/preview_openstreetmap_fr.png',
368386
'{/literal}{$OSM_PATH}{literal}leaflet/icons/preview_mapquest.png',
369387
'{/literal}{$OSM_PATH}{literal}leaflet/icons/preview_mapquest_aerial.png',
370-
'https://a.tile.cloudmade.com/7807cc60c1354628aab5156cfc1d4b3b/997/256/5/15/11.png',
371388
'{/literal}{$OSM_PATH}{literal}leaflet/icons/preview_toner.png',
372-
custom_url
389+
custom_url,
390+
'{/literal}{$OSM_PATH}{literal}leaflet/icons/preview_Esri.WorldTopoMap.png'
373391
);
374392
//alert(baselayer[select.selectedIndex]);
375393
var img_elem = document.getElementById("tile_preview");

include/functions_map.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ function osmcopyright($attrleaflet, $attrimagery, $attrmodule, $bl, $custombasel
4040
else if($bl == 'mapnikde') $return .= "Tiles Courtesy of Openstreetmap.de (CC BY-SA)";
4141
else if($bl == 'blackandwhite') $return .= "Tiles Courtesy of OSM.org (CC BY-SA)";
4242
else if($bl == 'mapnikhot') $return .= 'Tiles Courtesy of &copy; <a href="http://hot.openstreetmap.org/" target="_blank">Humanitarian OpenStreetMap Team</a>';
43-
else if($bl == 'cloudmade') $return .= 'Tiles Courtesy of &copy; <a href="http://cloudmade.com">CloudMade</a> ';
4443
else if($bl == 'mapquest') $return .= 'Tiles Courtesy of &copy; <a href="http://www.mapquest.com/">MapQuest</a>';
4544
else if($bl == 'mapquestaerial') $return .= 'Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> &mdash; Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency';
4645
else if($bl == 'toner') $return .= 'Tiles Courtesy of &copy; <a href="http://stamen.com">Stamen Design</a>, <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> &mdash;';
4746
else if($bl == 'custom') $return .= $custombaselayer;
47+
else if($bl == 'esri') $return .= "Tiles &copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community";
4848
}
4949
// Mandatory by http://www.openstreetmap.org/copyright
5050
$return .= ' &copy; ';
@@ -305,14 +305,14 @@ function osm_get_js($conf, $local_conf, $js_data)
305305
// Load baselayerURL
306306
if ($baselayer == 'mapnik') $baselayerurl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
307307
else if($baselayer == 'mapquest') $baselayerurl = 'http://otile1.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png';
308-
else if($baselayer == 'cloudmade') $baselayerurl = 'http://{s}.tile.cloudmade.com/7807cc60c1354628aab5156cfc1d4b3b/997/256/{z}/{x}/{y}.png';
309308
else if($baselayer == 'mapnikde') $baselayerurl = 'http://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png';
310309
else if($baselayer == 'mapnikfr') $baselayerurl = 'http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png';
311310
else if($baselayer == 'blackandwhite') $baselayerurl = 'http://{s}.www.toolserver.org/tiles/bw-mapnik/{z}/{x}/{y}.png';
312311
else if($baselayer == 'mapnikhot') $baselayerurl = 'http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png';
313312
else if($baselayer == 'mapquestaerial') $baselayerurl = 'http://otile1.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.png';
314313
else if($baselayer == 'toner') $baselayerurl = 'https://stamen-tiles-{s}.a.ssl.fastly.net/toner/{z}/{x}/{y}.png';
315314
else if($baselayer == 'custom') $baselayerurl = $custombaselayerurl;
315+
else if($baselayer == 'esri') $baselayerurl = 'http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}';
316316

317317
$attribution = osmcopyright($attrleaflet, $attrimagery, $attrmodule, $baselayer, $custombaselayer);
318318

12.2 KB
Loading

0 commit comments

Comments
 (0)