forked from qgis/QGIS-Web-Client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GlobalOptions.js
executable file
·323 lines (286 loc) · 11 KB
/
GlobalOptions.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
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
//default language code, can be overwritten with lang parameter in URL
var lang = "en"; //for available codes see array availableLanguages in file GlobalOptions.js
//Help file (must be a local file)
var helpfile = "help_en.html";
//Servername (optional) and path and name name of QGIS mapserver FCGI-file
//either with or without server-name - without servername recommended for easier porting to other servers
//do not add a ? or & after the .fcgi extension
var serverAndCGI = "/cgi-bin/qgis_mapserv.fcgi";
//Define whether you want to use the GetProjectSettings extension of QGIS Server
//for more configuration options in the project.
//Set this to false to use GetCapabilities for older QGIS Server versions (<= 1.8).
var useGetProjectSettings = true;
// show the layerOrderTab in the GUI
var showLayerOrderTab = true;
// use geodesic measures, i.e. not planar measures
// this is useful if a projection with high distortion of length/area is used, eg.g. GoogleMercator
var useGeodesicMeasurement = true;
//search box for queries while typing
//enable to use GeoNames search
var useGeoNamesSearchBox = false;
//URL for custom search scripts
var searchBoxQueryURL = null; // "/wsgi/search.wsgi?query=";
var searchBoxGetGeomURL = null; // "/wsgi/getSearchGeom.wsgi";
// Used to dynamically determine the project.
var project_map = Ext.urlDecode(window.location.search.substring(1)).map;
// PHP based search scripts (postgis layers only)
//var searchBoxQueryURL = '../php/search.php?map=' + project_map;
//var searchBoxGetGeomURL = '../php/search_geom.php?map=' + project_map;
//use a URL shortener for your permalink function
var permaLinkURLShortener = null; // "/wsgi/createShortPermalink.wsgi";
// enable to use commercial Google and Bing layers (also add BingApiKey in WebgisInit.js)
var enableBingCommercialMaps = false;
var enableGoogleCommercialMaps = true;
var enableBGMaps = false;
if (enableBingCommercialMaps || enableGoogleCommercialMaps) {
enableBGMaps = true;
}
// do not show fields in ObjectIdentification results that have null values
var suppressEmptyValues = true;
// hide geometry in ObjectIdentification results (should be only false if there is a good reason to do so)
var suppressInfoGeometry = true;
// do show field names in click-popup during object identification
var showFieldNamesInClickPopup = true;
// do show the layer title in the hover popup
var showHoverLayerTitle = true;
// max-width and max-height of the feature-info popup can be controlled in site/css/popup.css
//config for QGIS.SearchPanel
var simpleWmsSearch = {
title: "Search continent",
query: 'simpleWmsSearch',
useWmsRequest: true,
queryLayer: "Country",
formItems: [
{
xtype: 'textfield',
name: 'name',
fieldLabel: "Name",
allowBlank: false,
blankText: "Please enter a name (e.g. 'africa')",
filterOp: "="
}
],
gridColumns: [
{header: 'Name', dataIndex: 'name', menuDisabled: 'true'}
],
selectionLayer: 'Country',
selectionZoom: 0,
doZoomToExtent: true
};
var urlRewriteSearch = {
title: "Search letter",
query: 'samplesearch',
formItems: [
{
xtype: 'hidden',
name: 'query',
value: 'samplesearch'
},
{
xtype: 'textfield',
name: 'colour',
fieldLabel: "Colour",
allowBlank: false,
blankText: "Please enter a colour (e.g. 'orange')"
}
],
gridColumns: [
{header: 'PKUID', dataIndex: 'pkuid', menuDisabled: 'true'},
{header: 'Colour', dataIndex: 'colour', menuDisabled: 'true'}
],
selectionLayer: 'Hello',
selectionZoom: 1
};
//list of configs for QGIS.SearchPanel per map name
var mapSearchPanelConfigs = {
"helloworld": [simpleWmsSearch, urlRewriteSearch]
};
// ABP: needed for helloworld if no rewrite
mapSearchPanelConfigs[project_map] = [simpleWmsSearch, urlRewriteSearch];
//templates to define tooltips for a layer, to be shown on hover identify. The layer fields must be wrapped inside <%%> special tags.
//if a layers field is found with the name "tooltip" its content will have precedence over this configuration
var tooltipTemplates = {
'Country':{
template: "Look for the country on Google Search: <a href='http://www.google.it/#output=search&q=<%name%>' target='_blank'><%name%></a>"
},
};
// SearchPanel search results output configuration
// by default, search results will be shown in left panel, under the
// search form. Sometimes this is not desired, here you can choose to
// show the results in one of the other panels, like BottomPanel and
// RightPanel. These additional panels are hidden by default because
// their expansion and collapse trigger a map resize->reload cycle that
// can slow down the application.
var mapSearchPanelOutputRegion = 'popup' ; // Possible values: default,right,bottom,popup
// Interactive legend. This is based on PHP get_legend.php script.
// You can define here an alternate URL for this service
//var interactiveLegendGetLegendURL = '../php/get_legend.php?map=' + project_map + '&';
//define whether you want to display a map theme switcher
//note that you have to also link a gis-project-listing.js file containing a valid
//project listing structure - the root object is called 'gis_projects'
//have a look at the template file and documentation for the correct json structure
var mapThemeSwitcherActive = true;
//you can provide an alternative template for the theme-switcher - see also file ThemeSwitcher.js (ThemeSwitcher.prototype.initialize)
var themeSwitcherTemplate = null;
//first part of titlebar text
var titleBarText = "GIS-Browser - "; // will be appended with project title
// header logo image and link
var headerLogoImg = null; // path to image, set null for no logo
var headerLogoHeight = 60; // logo image height in pixels
var headerLogoLink = ""; // logo links to this URL
var headerTermsOfUseText = null; // set null for no link
var headerTermsOfUseLink = ""; // URL to terms of use
// optional project title per map name
var projectTitles = {
"helloworld": "Hello World"
};
//EPSG projection code of your QGIS project
var authid = "EPSG:"+3857;
//background transparency for the QGIS server generated layer (commercial background layers not effected)
//set to true if you want the background to be transparent, layer image will be bigger (32 vs 24bit)
var qgisLayerTransparency = true;
// OpenLayers global options
// see http://dev.openlayers.org/releases/OpenLayers-2.10/doc/apidocs/files/OpenLayers/Map-js.html
var MapOptions = {
projection: new OpenLayers.Projection(authid),
units: "m",
// maxScale:50,
// minScale:40000000,
// numZoomLevels:20,
fractionalZoom: enableBGMaps ? false : true,
transitionEffect:"resize",
controls: []
};
// Options for the main map layer (OpenLayers.layer)
//see http://dev.openlayers.org/releases/OpenLayers-2.12/doc/apidocs/files/OpenLayers/Layer-js.html
var LayerOptions = {
buffer:0,
singleTile:true,
ratio:1,
transitionEffect:"resize",
isBaseLayer: false,
projection:authid,
yx: {"EPSG:900913": false}
// If your projection is known to have an inverse axis order in WMS 1.3 compared to WMS 1.1 enter true for yx.
// For EPSG:900913 OpenLayers should know it by default but because of a bug in OL 2.12 we enter it here.
};
//overview map settings - do not change variable names!
var OverviewMapOptions = {
projection: new OpenLayers.Projection(authid),
units: "m",
maxScale:50,
minScale:300000000,
transitionEffect:"resize"
};
var OverviewMapSize = new OpenLayers.Size(200,200);
var overviewLayer = new OpenLayers.Layer.WMS("Overview-Map",
"/cgi-bin/qgis_mapserv.fcgi?map=/home/web/qgis-web-client/projects/naturalearth_110million.qgs",
{layers:"Land",format:"image/png"},
{buffer:0,singleTile:true,transitionEffect:"resize"});
// prevent the user from choosing a print resolution
// if fixedPrintResolution = null, the user is allowed to choose the print resolution.
var fixedPrintResolution = null // for a fixed resolution of 200dpi fill 200
//print options - scales and dpi
var printCapabilities={
"scales":[
{"name":"1:100","value":"100"},
{"name":"1:200","value":"200"},
{"name":"1:250","value":"250"},
{"name":"1:500","value":"500"},
{"name":"1:1'000","value":"1000"},
{"name":"1:2'000","value":"2000"},
{"name":"1:3'000","value":"3000"},
{"name":"1:5'000","value":"5000"},
{"name":"1:7'500","value":"7500"},
{"name":"1:10'000","value":"10000"},
{"name":"1:12'000","value":"12000"},
{"name":"1:15'000","value":"15000"},
{"name":"1:20'000","value":"20000"},
{"name":"1:25'000","value":"25000"},
{"name":"1:30'000","value":"30000"},
{"name":"1:50'000","value":"50000"},
{"name":"1:75'000","value":"75000"},
{"name":"1:100'000","value":"100000"},
{"name":"1:250'000","value":"250000"},
{"name":"1:500'000","value":"500000"},
{"name":"1:750'000","value":"750000"},
{"name":"1:1'000'000","value":"1000000"},
{"name":"1:2'500'000","value":"2500000"},
{"name":"1:5'000'000","value":"5000000"},
{"name":"1:7'500'000","value":"7500000"},
{"name":"1:10'000'000","value":"10000000"},
{"name":"1:15'000'000","value":"15000000"},
{"name":"1:20'000'000","value":"20000000"},
{"name":"1:25'000'000","value":"25000000"},
{"name":"1:30'000'000","value":"30000000"},
{"name":"1:35'000'000","value":"35000000"},
{"name":"1:50'000'000","value":"50000000"},
{"name":"1:60'000'000","value":"60000000"},
{"name":"1:75'000'000","value":"75000000"},
{"name":"1:100'000'000","value":"100000000"},
{"name":"1:125'000'000","value":"125000000"},
{"name":"1:150'000'000","value":"150000000"}
],
"dpis":[
{"name":"150 dpi","value":"150"},
{"name":"300 dpi","value":"300"},
{"name":"600 dpi","value":"600"},
{"name":"1200 dpi","value":"1200"}
],
"layouts":[]
};
// <------------ No changes should be needed below here ------------------>
//new namespace for QGIS extensions
//do not modify those three lines
if (!window.QGIS) {
window.QGIS = {};
}
//styling definitions for highlightLayer
//is used for hightlighting features (GetFeatureInfo and search result visualization)
//see http://dev.openlayers.org/releases/OpenLayers-2.10/doc/apidocs/files/OpenLayers/Style-js.html
var symbolizersHighLightLayer = {
"Point": {
pointRadius: 4,
graphicName: "circle",
fillColor: "#FF8C00",
fillOpacity: 0.3,
strokeWidth: 1,
strokeColor: "#FF8C00"
},
"Line": {
strokeWidth: 3,
strokeOpacity: 1,
strokeColor: "#FF8C00",
strokeDashstyle: "dash"
},
"Polygon": {
strokeWidth: 2,
strokeColor: "#FF8C00",
fillColor: "none"
}
};
//styling for measure controls (distance and area)
var sketchSymbolizersMeasureControls = {
"Point": {
pointRadius: 4,
graphicName: "square",
fillColor: "#FFFFFF",
fillOpacity: 1,
strokeWidth: 1,
strokeOpacity: 1,
strokeColor: "#FF0000"
},
"Line": {
strokeWidth: 3,
strokeOpacity: 1,
strokeColor: "#FF0000",
strokeDashstyle: "dash"
},
"Polygon": {
strokeWidth: 2,
strokeOpacity: 1,
strokeColor: "#FF0000",
fillColor: "#FFFFFF",
fillOpacity: 0.3
}
};