-
Notifications
You must be signed in to change notification settings - Fork 5
/
config.js
206 lines (187 loc) · 5.86 KB
/
config.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
/*
* Copyright (C) 2001-2016 Food and Agriculture Organization of the
* United Nations (FAO-UN), United Nations World Food Programme (WFP)
* and United Nations Environment Programme (UNEP)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2,
* Rome - Italy. email: geonetwork@osgeo.org
*/
(function () {
goog.provide("gn_search_dutch_config");
goog.require("gn_dutch_gazetteer_factory");
goog.require("gn_es_service");
var module = angular.module("gn_search_dutch_config", [
"gn_dutch_gazetteer_factory",
"gn_relatedresources_service"
]);
module.value(
"gnTplResultlistLinksbtn",
"../../catalog/views/default/directives/partials/linksbtn.html"
);
module.run([
"gnSearchSettings",
"gnViewerSettings",
"gnOwsContextService",
"gnMap",
"gnMapsManager",
"gnDefaultGazetteer",
"gnDutchGazetteer",
"gnESService",
"gnESFacet",
function (
searchSettings,
viewerSettings,
gnOwsContextService,
gnMap,
gnMapsManager,
gnDefaultGazetteer,
gnDutchGazetteer,
gnESService,
gnESFacet
) {
gnESService.addExcludeField('geometryUris');
if (viewerSettings.mapConfig.viewerMapLayers) {
console.warn(
'[geonetwork] Use of "mapConfig.viewerMapLayers" is deprecated. ' +
"Please configure layer per map type."
);
}
// Return date information and keywords in search results query
gnESFacet.configs.search.source.includes.push("resourceDate");
// Keep one layer in the background
// while the context is not yet loaded.
viewerSettings.bgLayers = [gnMap.createLayerForType("osm")];
viewerSettings.servicesUrl = viewerSettings.mapConfig.listOfServices || {};
// WMS settings
// If 3D mode is activated, single tile WMS mode is
// not supported by olcesium, so force tiling.
if (viewerSettings.mapConfig.is3DModeAllowed) {
viewerSettings.singleTileWMS = false;
// Configure Cesium to use a proxy. This is required when
// WMS does not have CORS headers. BTW, proxy will slow
// down rendering.
viewerSettings.cesiumProxy = true;
} else {
viewerSettings.singleTileWMS = viewerSettings.mapConfig.singleTileWMS;
}
var bboxStyle = new ol.style.Style({
stroke: new ol.style.Stroke({
color: "rgba(255,0,0,1)",
width: 2
}),
fill: new ol.style.Fill({
color: "rgba(255,0,0,0.3)"
})
});
searchSettings.olStyles = {
drawBbox: bboxStyle,
mdExtent: new ol.style.Style({
stroke: new ol.style.Stroke({
color: "orange",
width: 2
})
}),
mdExtentHighlight: new ol.style.Style({
stroke: new ol.style.Stroke({
color: "orange",
width: 3
}),
fill: new ol.style.Fill({
color: "rgba(255,255,0,0.3)"
})
})
};
gnMapsManager.initProjections(viewerSettings.mapConfig.switcherProjectionList);
var searchMap = gnMapsManager.createMap(gnMapsManager.SEARCH_MAP);
var viewerMap = gnMapsManager.createMap(gnMapsManager.VIEWER_MAP);
// To configure a gazetteer provider
viewerSettings.gazetteerProvider = gnDutchGazetteer;
/* Custom templates for search result views */
searchSettings.resultViewTpls = [
{
tplUrl: "../../catalog/views/dutch/templates/list.html",
tooltip: "List",
icon: "fa-bars"
}
];
// Mapping for md links in search result list.
searchSettings.linkTypes = {
links: ["LINK", "pdf", "docx"],
downloads: [
"DOWNLOAD",
"gml",
"kml",
"geojson",
"gpkg",
"x-sqlite3",
"json",
"jsonld",
"json-ld",
"rdf-xml",
"xml",
"zip",
"jp2",
"tiff",
"csv",
"OGC:WFS",
"OGC:WCS",
"OGC:SOS",
"INSPIRE Atom",
"OASIS:OData",
"OGC:SensorThings",
"W3C:SPARQL",
"OAS"
],
//layers:['OGC', 'kml'],
layers: ["OGC"],
maps: ["OGC:OWC"]
};
// Map protocols used to load layers/services in the map viewer
searchSettings.mapProtocols = {
layers: [
"OGC:WMS",
"OGC:WMTS",
"OGC:WMTS-1.1.0-http-get-tile",
"OGC:WMS-1.1.1-http-get-map",
"OGC:WMS-1.3.0-http-get-map",
"OGC:WFS",
"ESRI:REST",
"TMS",
"KML",
"GML"
],
services: [
"OGC:WMS-1.3.0-http-get-capabilities",
"OGC:WMS-1.1.1-http-get-capabilities",
"OGC:WMTS-1.0.0-http-get-capabilities",
"OGC:WFS-1.0.0-http-get-capabilities"
]
};
// Set custom config in gnSearchSettings
angular.extend(searchSettings, {
viewerMap: viewerMap,
searchMap: searchMap
});
}
]);
module.config([
"$LOCALES",
function ($LOCALES) {
$LOCALES.push("../../catalog/views/dutch/locales/|core");
}
]);
})();