forked from idera/mapa
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
210 lines (205 loc) · 6.63 KB
/
app.js
File metadata and controls
210 lines (205 loc) · 6.63 KB
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
var app;
var permalink;
Ext.onReady(function() {
GeoExt.Lang.set("es");
app = new gxp.Viewer({
proxy: "/mapa/proxy/?url=",
portalConfig: {
layout: "border",
items: [{
id: "centerpanel",
xtype: "tabpanel",
//layout: "fit",
region: "center",
border: false,
activeTab: 0,
items: ["mymap",
{
title: "Estado de Servidores WMS",
autoScroll: true,
html: "<iframe src='http://www.idera.gob.ar/portal/estadodeloswms'>"
}, {
title: "Ayuda",
autoScroll: true,
html: "<iframe src='help.html'>"
}, {
title: "Acerca de",
html: "<iframe src='about.html'>"
}]
}, {
id: "westcontainer",
xtype: "container",
layout: "vbox",
region: "west",
width: 200,
defaults: {
width: "100%",
layout: "fit"
},
items: [{
title: "Capas",
id: "layers_tree",
border: false,
flex: 1
}, {
height: 250,
layout: "accordion",
title: "Herramientas",
items: [{
title: "Leyenda",
id: "legend"
}, {
title: "Mapa de Referencia",
listeners: {'afterlayout': {fn: addOverview, single: true}},
html: "<div id='overviewmap' style='width:100%;height:100%;'></div>"
}, {
title: "Posición",
id: "position"
}]
}]
}]
},
// configuration of all tool plugins for this application
tools: [{
ptype: "gxp_layertree",
outputConfig: {
id: "tree",
border: true,
tbar: []
},
outputTarget: "layers_tree"
}, {
ptype: "gxp_addlayers",
actionTarget: "tree.tbar",
search: {selectedSource: "ideracsw"}
}, {
ptype: "gxp_removelayer",
actionTarget: ["tree.tbar", "tree.contextMenu"]
}, {
ptype: "gxp_zoomtolayerextent",
actionTarget: ["tree.tbar", "tree.contextMenu"]
}, {
ptype: "gxp_layerproperties",
actionTarget: ["tree.tbar", "tree.contextMenu"]
}, {
ptype: "gxp_zoomtoextent",
actionTarget: "map.tbar",
extent: new OpenLayers.Bounds(-111, -62, -16, -7)
}, {
ptype: "gxp_zoom",
showZoomBoxAction: true,
actionTarget: "map.tbar",
toggleGroup: "navegacion"
}, {
ptype: "gxp_navigationhistory",
actionTarget: "map.tbar",
toggleGroup: "navegacion"
}, {
ptype: "gxp_wmsgetfeatureinfo",
outputConfig: {
width: 400,
height: 400,
draggable:true
},
actionTarget: "map.tbar",
toggleGroup: "navegacion"
}, {
ptype: "gxp_measure",
outputConfig: {
width: 400,
height: "auto"
},
actionTarget: "map.tbar",
toggleGroup: "navegacion"
}, {
ptype: "gxp_legend",
outputTarget: "legend"
}, {
ptype: "gxp_print",
outputTarget: "map.tbar"
}, {
ptype: "gxp_googlegeocoder",
outputTarget: "map.tbar",
outputConfig: {
emptyText: "Buscar un lugar ..."
}
}, {
xtype: "gxp_scaleoverlay",
actionTarget: "map.tbar"
}, {
xtype: "tbbutton",
actionTarget: "map.tbar",
actions: [{
text: 'Permalink',
iconCls: "gxp-icon-permalink",
handler: function() {
Ext.MessageBox.show({
title: 'Permalink',
msg: 'Seleccione y copie el texto con Ctrl+C',
value: permalink,
multiline: true,
width: 500,
icon: Ext.MessageBox.INFO
});
}
}]
}/*, {
xtype: "tbbutton",
actionTarget: "map.tbar",
actions: [{
text: 'Cambiar a EPSG:900913',
handler: function() {
window.location = 'index900913.html';
}
}]
}*/],
// layer sources
defaultSourceType: "gxp_wmssource",
sources: sources,
// map and layers
map: {
id: "mymap",
title: "Mapa",
projection: "EPSG:4326",
units: "degrees",
//maxResolution: 156543.0339,
//maxExtent: [-75,-56,-52,-20],
center: [-64, -35],
zoom: 4,
stateId: "map",
prettyStateKeys: true,
layers: [{
source: "ign",
name: "argentina500k:argentina500k_satelital",
title: "Satelital SAC-C. IGN - CONAE",
//selected: false,
group: "background"
}, {
source: "ign",
name: "capabaseargenmap",
title: "Capa Base IGN",
selected: true,
//transparent:false,
group: "background"
}, {
source: "ol",
group: "background",
fixed: true,
type: "OpenLayers.Layer",
args: ["Sin capa base",
{
visibility: false
}]
}],
items: [{
xtype: "gx_zoomslider",
vertical: true,
height: 100
}]
}
});
app.mapPanel.map.events.register("mousemove", app.mapPanel.map, function (e) {
position = app.mapPanel.map.getLonLatFromViewPortPx(e.xy);
Ext.getCmp('position').update("<label>Latitud: " + position.lat + "</label><br/><label>Longitud: " + position.lon + "</label>");
});
});