1
|
/*
|
2
|
* Layer definitions for CdmOpenLayers (openlayers_map.js)
|
3
|
*/
|
4
|
|
5
|
(function() {
|
6
|
|
7
|
window.CdmOpenLayers.getLayerByName = function(layerName){
|
8
|
|
9
|
switch(layerName){
|
10
|
|
11
|
case 'metacarta_vmap0':
|
12
|
/**
|
13
|
* NOTE: labs.metacarta.com is currently unavailable
|
14
|
*
|
15
|
* Available Projections:
|
16
|
* EPSG:900913
|
17
|
* EPSG:4326
|
18
|
*/
|
19
|
return new OpenLayers.Layer.WMS(
|
20
|
"Metacarta Vmap0",
|
21
|
"http://labs.metacarta.com/wms/vmap0",
|
22
|
{layers: "basic", format:"png"},
|
23
|
{
|
24
|
maxExtent: window.CdmOpenLayers.mapExtends.epsg_4326,
|
25
|
projection: window.CdmOpenLayers.projections.epsg_4326,
|
26
|
isBaseLayer: true,
|
27
|
displayInLayerSwitcher: true
|
28
|
}
|
29
|
);
|
30
|
|
31
|
case 'osgeo_vmap0':
|
32
|
/**
|
33
|
* Available Projections:
|
34
|
* EPSG:4269
|
35
|
EPSG:4326
|
36
|
EPSG:900913
|
37
|
*/
|
38
|
return new OpenLayers.Layer.WMS(
|
39
|
"OSGEO Vmap0",
|
40
|
"http://vmap0.tiles.osgeo.org/wms/vmap0",
|
41
|
{layers: 'basic', format:"png"},
|
42
|
{
|
43
|
maxExtent: window.CdmOpenLayers.mapExtends.epsg_4326,
|
44
|
projection: new OpenLayers.Projection("EPSG:4326"),
|
45
|
isBaseLayer: true,
|
46
|
displayInLayerSwitcher: true
|
47
|
}
|
48
|
);
|
49
|
|
50
|
case 'mapproxy_vmap0':
|
51
|
/**
|
52
|
* Available Projections:
|
53
|
* EPSG:4269
|
54
|
EPSG:4326
|
55
|
EPSG:900913
|
56
|
*/
|
57
|
return new OpenLayers.Layer.WMS(
|
58
|
"OSGEO Vmap0 via mapproxy",
|
59
|
"http://geo.cybertaxonomy.org/mapproxy/service",
|
60
|
{layers: 'vmap0', format:"image/png"},
|
61
|
{
|
62
|
maxExtent: window.CdmOpenLayers.mapExtends.epsg_4326,
|
63
|
projection: new OpenLayers.Projection("EPSG:4326"),
|
64
|
isBaseLayer: true,
|
65
|
displayInLayerSwitcher: true
|
66
|
}
|
67
|
);
|
68
|
|
69
|
/**
|
70
|
* ETOPO1 Global Relief Model
|
71
|
*/
|
72
|
case 'edit-etopo1':
|
73
|
return new OpenLayers.Layer.WMS(
|
74
|
"ETOPO1 Global Relief Model",
|
75
|
"http://edit.africamuseum.be/geoserver/topp/wms",
|
76
|
{layers: 'topp:color_etopo1_ice_full', format:"image/png"},
|
77
|
{
|
78
|
maxExtent: window.CdmOpenLayers.mapExtends.epsg_4326,
|
79
|
projection: new OpenLayers.Projection("EPSG:4326"),
|
80
|
isBaseLayer: true,
|
81
|
displayInLayerSwitcher: true
|
82
|
}
|
83
|
);
|
84
|
|
85
|
/**
|
86
|
* ETOPO1 Global Relief Model
|
87
|
*/
|
88
|
case 'mapproxy_etopo1':
|
89
|
return new OpenLayers.Layer.WMS(
|
90
|
"ETOPO1 Global Relief Model via mapproxy",
|
91
|
"http://cybertaxonomy.org:8082/mapproxy/service",
|
92
|
{layers: 'etopo1', format:"image/png"},
|
93
|
{
|
94
|
maxExtent: window.CdmOpenLayers.mapExtends.epsg_4326,
|
95
|
projection: new OpenLayers.Projection("EPSG:4326"),
|
96
|
isBaseLayer: true,
|
97
|
displayInLayerSwitcher: true
|
98
|
}
|
99
|
);
|
100
|
|
101
|
/*
|
102
|
* OSM Layers:
|
103
|
*
|
104
|
* minZoomLevel is not supported for XYZ layers, of which OSM is a subclass.
|
105
|
* http://trac.osgeo.org/openlayers/ticket/2909
|
106
|
* http://trac.osgeo.org/openlayers/ticket/2189
|
107
|
* solution in OL 2.12
|
108
|
*
|
109
|
* see also http://stackoverflow.com/questions/4240610/min-max-zoom-level-in-openlayers
|
110
|
* and http://trac.osgeo.org/openlayers/wiki/SettingZoomLevels
|
111
|
*
|
112
|
* To allow OSM baselayers to zoom out to the full extend of the world the map width must be
|
113
|
* multiple of 256px since the osm tiles from tile.openstreetmap.org have a size of 256px x 256px
|
114
|
* and fractional tiles are not supported by XYZ layers like OSM
|
115
|
*/
|
116
|
case 'mapnik':
|
117
|
return new OpenLayers.Layer.OSM();
|
118
|
|
119
|
case 'mapquest_open':
|
120
|
// see http://developer.mapquest.com/web/products/open/map
|
121
|
return new OpenLayers.Layer.XYZ(
|
122
|
"MapQuest",
|
123
|
[
|
124
|
"http://otile1.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.png",
|
125
|
"http://otile2.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.png",
|
126
|
"http://otile3.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.png",
|
127
|
"http://otile4.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.png"
|
128
|
],
|
129
|
{
|
130
|
// If using the MapQuest-OSM tiles, OpenStreetMap must be given credit for the data
|
131
|
attribution: "Data, imagery and map information provided by <a href='http://www.mapquest.com/' target='_blank'>MapQuest</a>, <a href='http://www.openstreetmap.org/' target='_blank'>Open Street Map</a> and contributors, <a href='http://creativecommons.org/licenses/by-sa/2.0/' target='_blank'>CC-BY-SA</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",
|
132
|
transitionEffect: "resize"
|
133
|
}
|
134
|
);
|
135
|
|
136
|
case 'mapquest_sat':
|
137
|
// see http://developer.mapquest.com/web/products/open/map
|
138
|
return new OpenLayers.Layer.XYZ(
|
139
|
"MapQuest Sattelite",
|
140
|
[
|
141
|
"http://otile1.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.png",
|
142
|
"http://otile2.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.png",
|
143
|
"http://otile3.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.png",
|
144
|
"http://otile4.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.png"
|
145
|
],
|
146
|
{
|
147
|
// If using the MapQuest-OSM tiles, OpenStreetMap must be given credit for the data
|
148
|
attribution: "Data, imagery and map information provided by <a href='http://www.mapquest.com/' target='_blank'>MapQuest</a>, <a href='http://www.openstreetmap.org/' target='_blank'>Open Street Map</a> and contributors, <a href='http://creativecommons.org/licenses/by-sa/2.0/' target='_blank'>CC-BY-SA</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",
|
149
|
transitionEffect: "resize"
|
150
|
}
|
151
|
);
|
152
|
/*
|
153
|
ALl GOOGLE LAYERS DISABELED until the new map api is integrated
|
154
|
// create Google Mercator layers
|
155
|
case 'gmap':
|
156
|
return new OpenLayers.Layer.Google(
|
157
|
"Google Streets",
|
158
|
{
|
159
|
// the default type
|
160
|
projection: window.CdmOpenLayers.projections.epsg_900913,
|
161
|
// Allow user to pan forever east/west
|
162
|
// Setting this to false only restricts panning if sphericalMercator is true.
|
163
|
wrapDateLine: false,
|
164
|
sphericalMercator: true,
|
165
|
numZoomLevels: 21,
|
166
|
}
|
167
|
);
|
168
|
|
169
|
case 'gsat':
|
170
|
// FIMXE: layer distorted, use OpenLayers.Layer.Google.v3?
|
171
|
return new OpenLayers.Layer.Google(
|
172
|
"Google Satellite",
|
173
|
{
|
174
|
type: G_SATELLITE_MAP,
|
175
|
projection: window.CdmOpenLayers.projections.epsg_900913,
|
176
|
// Allow user to pan forever east/west
|
177
|
// Setting this to false only restricts panning if sphericalMercator is true.
|
178
|
wrapDateLine: false,
|
179
|
numZoomLevels: 22
|
180
|
}
|
181
|
);
|
182
|
case 'ghyb':
|
183
|
// FIMXE: layer not working, use OpenLayers.Layer.Google.v3?
|
184
|
return new OpenLayers.Layer.Google(
|
185
|
"Google Hybrid",
|
186
|
{
|
187
|
type: G_HYBRID_MAP,
|
188
|
projection: window.CdmOpenLayers.projections.epsg_900913,
|
189
|
// Allow user to pan forever east/west
|
190
|
// Setting this to false only restricts panning if sphericalMercator is true.
|
191
|
wrapDateLine: false,
|
192
|
numZoomLevels: 22
|
193
|
}
|
194
|
);
|
195
|
*/
|
196
|
/*
|
197
|
* FIXME: apiKey needs to be specified
|
198
|
case 'veroad':
|
199
|
case 'bing_road':
|
200
|
return new OpenLayers.Layer.Bing({
|
201
|
name: "Road",
|
202
|
key: apiKey,
|
203
|
type: "Road"
|
204
|
});
|
205
|
|
206
|
case 'vehyb':
|
207
|
case 'bing_hybrid':
|
208
|
return new OpenLayers.Layer.Bing({
|
209
|
name: "Hybrid",
|
210
|
key: apiKey,
|
211
|
type: "AerialWithLabels"
|
212
|
});
|
213
|
|
214
|
case 'veaer':
|
215
|
case 'bing_arial':
|
216
|
return new OpenLayers.Layer.Bing({
|
217
|
name: "Aerial",
|
218
|
key: apiKey,
|
219
|
type: "Aerial"
|
220
|
});
|
221
|
|
222
|
*/
|
223
|
|
224
|
}
|
225
|
|
226
|
return null;
|
227
|
};
|
228
|
|
229
|
|
230
|
})();
|
231
|
|