-
Notifications
You must be signed in to change notification settings - Fork 0
/
style.js
126 lines (122 loc) · 3.25 KB
/
style.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
// Samme stiler som er brukt på norgeskart.no
// style for drawing point, line, polygon
var measureSketchSymbolizers = {
"Point": {
pointRadius: 4,
graphicName: "square",
fillColor: "white",
fillOpacity: 1,
strokeWidth: 1,
strokeOpacity: 1,
strokeColor: "#333333"
},
"Line": {
strokeWidth: 3,
strokeOpacity: 1,
strokeColor: "#666666",
strokeDashstyle: "dash"
},
"Polygon": {
strokeWidth: 2,
strokeOpacity: 1,
strokeColor: "#666666",
fillColor: "white",
fillOpacity: 0.3
}
};
var measureStyle = new OpenLayers.Style();
measureStyle.addRules([
new OpenLayers.Rule({symbolizer: measureSketchSymbolizers})
]);
var measureStyleMap = new OpenLayers.StyleMap({"default": measureStyle});
//************************************
// style for highlight point, line, polygon
var highlightSymbolizers = {
"Point": {
pointRadius: 9,
fillColor: "#FF9933",
fillOpacity: 0.4,
strokeWidth: 1,
strokeOpacity: 1,
strokeColor: "#FF9933"
},
"Line": {
strokeColor: "#FF9933",
strokeOpacity: 0.4,
strokeWidth: 8,
strokeLinecap: "round"
},
"Polygon": {
strokeWidth: 3,
strokeOpacity: 0.8,
strokeColor: "#FF9933",
fillColor: "#FF9933",
fillOpacity: 0.5
}
};
var highlightStyle = new OpenLayers.Style();
highlightStyle.addRules([
new OpenLayers.Rule({symbolizer: highlightSymbolizers})
]);
var highlightStyleMap = new OpenLayers.StyleMap({"default": highlightStyle});
//************************************
// style for selecting point, line, polygon
var selectSymbolizers = {
"Point": {
pointRadius: 9,
fillColor: "#333333",
fillOpacity: 0.4,
strokeWidth: 1,
strokeOpacity: 1,
strokeColor: "#333333"
},
"Line": {
strokeColor: "#666666",
strokeOpacity: 0.4,
strokeWidth: 8,
strokeLinecap: "round"
},
"Polygon": {
strokeWidth: 3,
strokeOpacity: 0.8,
strokeColor: "#666666",
fillColor: "#666666",
fillOpacity: 0.5
}
};
var selectStyle = new OpenLayers.Style();
selectStyle.addRules([
new OpenLayers.Rule({symbolizer: selectSymbolizers})
]);
var selectStyleMap = new OpenLayers.StyleMap({"default": selectStyle});
//************************************
// style for drawing point, line, polygon
var measureSketchSymbolizers = {
"Point": {
pointRadius: 4,
graphicName: "square",
fillColor: "white",
fillOpacity: 1,
strokeWidth: 1,
strokeOpacity: 1,
strokeColor: "#333333"
},
"Line": {
strokeWidth: 3,
strokeOpacity: 1,
strokeColor: "#666666",
strokeDashstyle: "dash"
},
"Polygon": {
strokeWidth: 2,
strokeOpacity: 1,
strokeColor: "#666666",
fillColor: "white",
fillOpacity: 0.3
}
};
var measureStyle = new OpenLayers.Style();
measureStyle.addRules([
new OpenLayers.Rule({symbolizer: measureSketchSymbolizers})
]);
var measureStyleMap = new OpenLayers.StyleMap({"default": measureStyle});