Skip to content

Commit 48d8c10

Browse files
committed
updated 4 osmLayers
1 parent c3eadf1 commit 48d8c10

File tree

2 files changed

+53
-42
lines changed

2 files changed

+53
-42
lines changed

themes/mapmint/layouts/_default/home.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ <h1 class="msg">fast <span class="colored">&</span> easy <span class="colored">w
3939
<div class="gdal"></div>
4040
<div class="qst"></div>
4141
<div class="map0"><a href="#" class="zero" onclick="map.setBaseLayer(osm);"></a></div>
42-
<div class="map1"><a href="#" class="one" onclick="map.setBaseLayer(baseOSM);"></a></div>
43-
<div class="map2"><a href="#" class="two" onclick="map.setBaseLayer(gmap);"></a></div>
44-
<div class="map3"><a href="#" class="three" onclick="map.setBaseLayer(gphy);"></a></div>
45-
<div class="map4"><a href="#" class="four" onclick="map.setBaseLayer(stamenLayer);"></a></div>
46-
<div class="map5"><a href="#" class="five" onclick="map.setBaseLayer(gsat);"></a></div>
42+
<div class="map1"><a href="#" class="one" onclick="map.setBaseLayer(cyclOSMLayer);"></a></div>
43+
<div class="map2"><a href="#" class="two" onclick="map.setBaseLayer(hotOSMLayer);"></a></div>
44+
<div class="map3"><a href="#" class="three" onclick="map.setBaseLayer(cartoPositronLayer);"></a></div>
45+
<div class="map4"><a href="#" class="four" onclick="map.setBaseLayer(topoLayer);"></a></div>
46+
<div class="map5"><a href="#" class="five" onclick="map.setBaseLayer(stamenWatercolorLayer);"></a></div>
4747
</div>
4848
</div>
4949
</div>

themes/mapmint/static/js/home2.js

Lines changed: 48 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ var lonlat;
33
var gsat, gmap, gphy, ghyb, streetlayer;
44
var baseOSM, osm, OSMgs;
55
var cycle;
6-
var stamenLayer;
76
var topoLayer;
7+
var cyclOSMLayer;
8+
var humanOSMLayer;
9+
10+
811

912
function init() {
1013
if (!OpenLayers.CANVAS_SUPPORTED) {
@@ -36,46 +39,54 @@ function init() {
3639
controls: []
3740
});
3841

39-
topoLayer = new OpenLayers.Layer.XYZ("OpenTopoMap", [
40-
"http://c.tile.opentopomap.org/{z}/{x}/{y}.png"
41-
], {
42-
attribution: "Tiles &copy; <a href='http://opentopomap.org/'>OpenTopoMap</a> (CC-BY-SA)",
43-
isBaseLayer: true
44-
});
45-
46-
baseOSM = new OpenLayers.Layer.TMS("MapQuest", "http://otile1.mqcdn.com/tiles/1.0.0/osm/", {
47-
type: 'png',
48-
getURL: osm_getTileURL,
49-
displayOutsideMaxExtent: true,
50-
isBaseLayer: true,
51-
attribution: "Data by <a href='http://www.mapquest.com/' target='_blank'>MapQuest</a>, CC-BY-SA <a href='http://www.openstreetmap.org/' target='_blank'>Open Street Map</a>",
52-
transitionEffect: "resize"
53-
});
54-
55-
stamenLayer = new OpenLayers.Layer.Stamen("watercolor");
56-
57-
gphy = new OpenLayers.Layer.Google(
58-
"Google Physical",
59-
{type: google.maps.MapTypeId.TERRAIN}
60-
);
61-
gmap = new OpenLayers.Layer.Google(
62-
"Google Streets", // the default
63-
{numZoomLevels: 20}
64-
);
65-
ghyb = new OpenLayers.Layer.Google(
66-
"Google Hybrid",
67-
{type: google.maps.MapTypeId.HYBRID, numZoomLevels: 20}
68-
);
69-
gsat = new OpenLayers.Layer.Google(
70-
"Google Satellite",
71-
{type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 22}
72-
);
42+
topoLayer = new OpenLayers.Layer.OSM(
43+
"OpenTopoMap",
44+
[
45+
"http://a.tile.opentopomap.org/${z}/${x}/${y}.png",
46+
"http://b.tile.opentopomap.org/${z}/${x}/${y}.png",
47+
"http://c.tile.opentopomap.org/${z}/${x}/${y}.png"
48+
],
49+
{
50+
attribution: "Tiles &copy; <a href='http://opentopomap.org/'>OpenTopoMap</a> (CC-BY-SA)",
51+
isBaseLayer: true
52+
}
53+
);
54+
55+
cyclOSMLayer = new OpenLayers.Layer.OSM(
56+
"CyclOSM",
57+
[
58+
"http://a.tile-cyclosm.openstreetmap.fr/cyclosm/${z}/${x}/${y}.png",
59+
"http://b.tile-cyclosm.openstreetmap.fr/cyclosm/${z}/${x}/${y}.png",
60+
"http://c.tile-cyclosm.openstreetmap.fr/cyclosm/${z}/${x}/${y}.png"
61+
],
62+
{
63+
attribution: "Tiles © <a href='http://www.cyclosm.org/'>CyclOSM</a>, OpenStreetMap contributors",
64+
isBaseLayer: true
65+
}
66+
);
67+
68+
humanOSMLayer = new OpenLayers.Layer.OSM(
69+
"HOT OSM",
70+
[
71+
"http://tile-a.openstreetmap.fr/hot/${z}/${x}/${y}.png",
72+
"http://tile-b.openstreetmap.fr/hot/${z}/${x}/${y}.png",
73+
"http://tile-c.openstreetmap.fr/hot/${z}/${x}/${y}.png"
74+
],
75+
{
76+
attribution: "Tiles © <a href='http://www.openstreetmap.org/'>OpenStreetMap</a>, Humanitarian style",
77+
isBaseLayer: true
78+
}
79+
);
7380

81+
7482
osm = new OpenLayers.Layer.OSM({
7583
attribution: "Data by <a href='http://www.openstreetmap.org/' target='_blank'>Open Street Map</a>,<a href='http://www.openstreetmap.org/' target='_blank'>OpenStreetMap</a> contributors, <a href='http://creativecommons.org/licenses/by-sa/2.0/' target='_blank'>CC-BY-SA</a>"
7684
} );
85+
86+
87+
map.addLayers([osm, cyclOSMLayer, humanOSMLayer, topoLayer]);
88+
map.setBaseLayer(cyclOSMLayer);
7789

78-
map.addLayers([OSMgs, osm, topoLayer]);
7990

8091
var attr = new OpenLayers.Control.Attribution();
8192
map.addControl(attr);
@@ -209,7 +220,7 @@ setTimeout(function() {
209220
map.setBaseLayer(gmap);
210221
$(".map3").animate({opacity:1, marginLeft: '67%', marginTop:'-110px', zIndex:'1'}, 2000, function() {
211222
map.setBaseLayer(gphy);
212-
$(".anim").css({"background" : "url(assets/images/pasaconh.png) no-repeat"});
223+
$(".anim").css({"background" : "url(../../images/pasaconh.png) no-repeat"});
213224
$('.endmess').fadeOut(1000);
214225
$(".map4").animate({opacity:1, marginLeft: '74%', marginTop:'-20px', zIndex:'1'}, 2000, function() {
215226
map.setBaseLayer(stamenLayer);

0 commit comments

Comments
 (0)