forked from openlayers/openlayers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathepsg-4326.js
41 lines (38 loc) · 1 KB
/
epsg-4326.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
goog.require('ol.Coordinate');
goog.require('ol.Map');
goog.require('ol.RendererHint');
goog.require('ol.View2D');
goog.require('ol.control.ScaleLine');
goog.require('ol.control.ScaleLineUnits');
goog.require('ol.control.defaults');
goog.require('ol.layer.TileLayer');
goog.require('ol.source.TiledWMS');
var layers = [
new ol.layer.TileLayer({
source: new ol.source.TiledWMS({
url: 'http://vmap0.tiles.osgeo.org/wms/vmap0',
crossOrigin: null,
params: {
'VERSION': '1.1.1',
'LAYERS': 'basic',
'FORMAT': 'image/jpeg'
}
})
})
];
var map = new ol.Map({
controls: ol.control.defaults({}, [
new ol.control.ScaleLine({
units: ol.control.ScaleLineUnits.DEGREES
})
]),
layers: layers,
// The OSgeo server does not set cross origin headers, so we cannot use WebGL
renderers: [ol.RendererHint.CANVAS, ol.RendererHint.DOM],
target: 'map',
view: new ol.View2D({
projection: 'EPSG:4326',
center: new ol.Coordinate(0, 0),
zoom: 2
})
});