-
Notifications
You must be signed in to change notification settings - Fork 1
/
OpLayPrev_SKI_orig.js
128 lines (95 loc) · 2.88 KB
/
OpLayPrev_SKI_orig.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
var sourcebase = new ol.source.BingMaps({
key: 'AgQRwdWCKHZjOU-fQDBXp1sy8t3AJcjhvGeI4FCBMomdQ8wHBHnGsFdhZLD24cUR',
imagerySet: 'Aerial'
})
// MY BASE************************************************************
var Layer_Bing_aerial = new ol.layer.Tile({
source: sourcebase
});
// MY BASE************************************************************
// var raster = new ol.layer.Tile({
// source: new ol.source.OSM()
// });
// MY BASE************************************************************
var view1 = new ol.View({
center: ol.proj.fromLonLat([-106.79358,37.47476]),
zoom: 16
});
// MY BASE************************************************************
var map = new ol.Map({
target: 'map1',
// a map without layers can be defined and in that case a map with no layers
// will be rendered
layers: [
Layer_Bing_aerial
],
view: view1
});
// create a map with options specified in a separate 'options' variable and
// included by reference in the code to create the new map object
// optional options - only include those that you need
// controls: ...,
// pixelRatio: ...,
// interactions:[
var source = new ol.source.Vector();
var vector = new ol.layer.Vector({
source: source,
style: new ol.style.Style({
fill: new ol.style.Fill({
color: 'rgba(255, 255, 255, 0.2)'
}),
stroke: new ol.style.Stroke({
color: '#ffcc33',
width: 2
}),
image: new ol.style.Circle({
radius: 7,
fill: new ol.style.Fill({
color: '#ffcc33'
})
})
})
});
var modify = new ol.interaction.Modify({source: source});
map.addInteraction(modify);
var draw, snap; // global so we can remove them later
var typeSelect = document.getElementById('type');
function addInteractions() {
draw = new ol.interaction.Draw({
source: source,
type: typeSelect.value
});
map.addInteraction(draw);
snap = new ol.interaction.Snap({source: source});
map.addInteraction(snap);
}
/**
* Handle change event.
*/
typeSelect.onchange = function() {
map.removeInteraction(draw);
map.removeInteraction(snap);
addInteractions();
};
addInteractions();
// keyboardEventTarget: ...,
// loadTilesWhileAnimating: ...,
// loadTilesWhileInteracting: ...,
// logo: ...,
// overlays: ...,
// renderer: ...
// WMS
var basemap_tiled = new ol.layer.Tile({
9 source: new ol.source.TileWMS({
10 url: 'https://services.nationalmap.gov/arcgis/services/Contours/MapServer/WmsServer',
11 params: {
12 LAYERS: '18,19',
13 FORMAT: 'image/png',
14 TRANSPARENT: true
15 },
16 attributions: [
17 new ol.Attribution({
18 html: 'Data provided by the GEOG x85 GeoServer.'
19 })
20 ]
21 }