-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
83 lines (77 loc) · 1.74 KB
/
main.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
import './style.css';
import 'ol/ol.css';
import Map from 'ol/Map';
import View from 'ol/View';
import OSM from 'ol/source/OSM';
import { Style, Circle, Fill } from 'ol/style';
import TileLayer from 'ol/layer/Tile.js';
import Feature from 'ol/Feature';
var map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
],
view: new ol.View({
center: [-13432000, 4204600],
zoom: 8
})
});
var slo = new ol.layer.Vector({
source: new ol.source.Vector({
projection: 'EPSG:4326',
// radius = 4000 meters
features: [new ol.Feature(new ol.geom.Circle([-13432000, 4204600], 4000))]
}),
style: [
new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'blue',
width: 3
}),
fill: new ol.style.Fill({
color: 'rgba(0, 100, 255, 1)'
})
})
]
});
var carp = new ol.layer.Vector({
source: new ol.source.Vector({
projection: 'EPSG:4326',
// radius = 4000 meters
features: [new ol.Feature(new ol.geom.Circle([-13304490, 4082033], 4000))]
}),
style: [
new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'green',
width: 3
}),
fill: new ol.style.Fill({
color: 'rgba(0, 255, 100, 1)'
})
})
]
});
var sac = new ol.layer.Vector({
source: new ol.source.Vector({
projection: 'EPSG:4326',
// radius = 4000 meters
features: [new ol.Feature(new ol.geom.Circle([-13461874, 4673979], 4000))]
}),
style: [
new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'red',
width: 3
}),
fill: new ol.style.Fill({
color: 'rgba(255, 100, 0, 1)'
})
})
]
});
map.addLayer(slo);
map.addLayer(carp);
map.addLayer(sac);