This repository has been archived by the owner on Jan 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
index-config-from-file.html
100 lines (87 loc) · 3.74 KB
/
index-config-from-file.html
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
<!DOCTYPE html>
<!--
Copyright (C) 2014 Härnösands kommun
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<!--
Integration file that uses a plain file config stored on the web server.
-->
<html lang="sv">
<head>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Open eMap Client</title>
<meta name="description" content="">
<meta name="author" content="Anders Erlandsson, Sundsvalls kommun" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="/libs/ext-theme-oep/ext-theme-oep-all.css">
<link rel="stylesheet" type="text/css" href="resources/css/OpenEMap.css">
<script type="text/javascript" src="/libs/ext-4.2.1/ext-all.js"></script>
<script type="text/javascript" src="/libs/ext-4.2.1/ext-theme-neptune.js"></script>
<script type="text/javascript" src="/libs/ext-4.2.1/locale/ext-lang-sv_SE.js"></script>
<script type="text/javascript" src="/libs/OpenLayers-2.13.1/OpenLayers.js"></script>
<script type="text/javascript" src="/libs/proj4js/proj4-compressed.js"></script>
<script type="text/javascript" src="proj4_defs.js"></script>
<script type="text/javascript" src="/libs/geoext-2.0.2-rc.1-all.js"></script>
<script type="text/javascript" src="/libs/es5-shim.min.js"></script>
<script type="text/javascript" src="OpenEMap-1.6.0-rc.3-min.js"></script>
<script type="text/javascript">
Ext.onReady(function() {
var mapClient = Ext.create('OpenEMap.Client');
function init(config) {
var gui = {
map: false,
toolbar: { },
zoomTools: {},
layers: {type: 'basic', legendDelay: 0},
baseLayers: {},
searchFastighet: { },
objectConfig: { }
};
mapClient.destroy();
mapClient.configure(Ext.clone(config), {
gui: gui
});
var labels = new OpenLayers.Rule({
filter: new OpenLayers.Filter.Comparison({
type: OpenLayers.Filter.Comparison.EQUAL_TO,
property: "type",
value: "label",
}),
symbolizer: {
pointRadius: 20,
fillOpacity: 0,
strokeOpacity: 0,
label: "${label}"
}
});
mapClient.drawLayer.styleMap.styles['default'].addRules([labels]);
mapClient.toggleEdgeLabels();
}
Ext.Ajax.request({
// path to local file used as map config
url : 'config/testAll.json',
method : 'GET',
success : function(evt){
var config = JSON.parse(evt.responseText);
init(config);
},
error : function(evt){
Ext.MessageBox.alert('Erro', 'Error getting configurations: ' + evt.message);
}
});
});
</script>
</head>
<body>
</body>
</html>