Commit 516bb4a5 authored by FORESTIER Fabien's avatar FORESTIER Fabien Committed by ncastejon
Browse files

Make sure cache is not used for real time data + Use 2018 version of orthophoto

parent 3645d1ad
......@@ -34,6 +34,7 @@ export interface IElasticsearchOptions {
'shouldAggregateResultCount': boolean;
'shouldAggregateFilters': boolean;
'scope': IScope;
'useCache': boolean;
}
export class ElasticsearchOptions {
......@@ -47,7 +48,8 @@ export class ElasticsearchOptions {
'shouldAggregateFilters': boolean;
'fromAutocompletion': boolean;
'scope': IScope;
otherLicenceAggregations: string[];
'useCache': boolean;
'otherLicenceAggregations': string[];
constructor(data?) {
this.from = (data && data.from != null) ? data.from : 0;
......@@ -59,6 +61,7 @@ export class ElasticsearchOptions {
this.fromAutocompletion = false;
this.scope = (data.scope) ? data.scope : scopesResearch.all;
this.otherLicenceAggregations = [];
this.useCache = (data && data.useCache != null) ? data.useCache : true;
// Need to be done in order to avoid object reference copy
this._sortOptions = {
......
......@@ -95,6 +95,9 @@ export class DatasetDetailService {
this._dataset.metadata = metadata;
this._dataset.editorialMetadata = new EditorialMetadata(e.hits.hits[0]._source['editorial-metadata']);
// Disable cache for real time dataset
this._elasticSearchOptions.useCache = this.datasetEditorialMetadata.isRealTime ? false : true;
} else {
this._dataset.metadata = new Metadata();
}
......
......@@ -162,8 +162,12 @@ export class ElasticsearchService {
},
];
}
const headers = options.useCache ? {} : { nocache: 'True' };
return this._http.request<IElasticsearchResponse>('POST', this.elasticSearchUrl, {
body,
headers,
withCredentials: true,
}).pipe(
catchError(
......
{
"version": 8,
"sources": {
"raster-tiles": {
"type": "raster",
"tiles": ["https://ortho.data.grandlyon.com/?bbox={bbox-epsg-3857}&format=image/jpeg&service=WMS&version=1.1.1&request=GetMap&srs=EPSG:3857&width=512&height=512&transparent=true&layers=ortho2015"],
"maxzoom": 21,
"attribution": "© <a href='https://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors"
"version": 8,
"sources": {
"raster-tiles": {
"type": "raster",
"tiles": [
"https://ortho.data.grandlyon.com/?bbox={bbox-epsg-3857}&format=image/jpeg&service=WMS&version=1.1.1&request=GetMap&srs=EPSG:3857&width=512&height=512&transparent=true&layers=ortho2018"
],
"maxzoom": 21,
"attribution": "© <a href='https://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors"
},
"openmaptiles": {
"type": "vector",
"tiles": [
"https://openmaptiles.data.grandlyon.com/data/v3/{z}/{x}/{y}.pbf"
],
"minzoom": 0,
"maxzoom": 22
}
},
"glyphs": "https://openmaptiles.geo.data.gouv.fr/fonts/{fontstack}/{range}.pbf",
"layers": [
{
"id": "simple-tiles",
"type": "raster",
"source": "raster-tiles"
},
{
"id": "road_major_label",
"type": "symbol",
"source": "openmaptiles",
"source-layer": "transportation_name",
"filter": [
"==",
"$type",
"LineString"
],
"layout": {
"symbol-placement": "line",
"text-field": "{name:latin} {name:nonlatin}",
"text-font": [
"Noto Sans Regular"
],
"text-transform": "uppercase",
"text-letter-spacing": 0.1,
"text-size": {
"base": 1.4,
"stops": [
[
10,
8
],
[
20,
14
]
]
},
"openmaptiles": {
"type": "vector",
"tiles": [
"https://openmaptiles.data.grandlyon.com/data/v3/{z}/{x}/{y}.pbf"
],
"minzoom": 0,
"maxzoom": 22
}
},
"glyphs": "https://openmaptiles.geo.data.gouv.fr/fonts/{fontstack}/{range}.pbf",
"layers": [{
"id": "simple-tiles",
"type": "raster",
"source": "raster-tiles"
"text-rotation-alignment": "map"
},
{
"id": "road_major_label",
"type": "symbol",
"source": "openmaptiles",
"source-layer": "transportation_name",
"filter": [
"paint": {
"text-color": "#fff",
"text-halo-color": "black",
"text-halo-width": 2
}
},
{
"id": "place_label_other",
"type": "symbol",
"source": "openmaptiles",
"source-layer": "place",
"minzoom": 8,
"filter": [
"all",
[
"==",
"$type",
"LineString"
"Point"
],
"layout": {
"symbol-placement": "line",
"text-field": "{name:latin} {name:nonlatin}",
"text-font": [
"Noto Sans Regular"
],
"text-transform": "uppercase",
"text-letter-spacing": 0.1,
"text-size": {
"base": 1.4,
"stops": [
[
10,
8
],
[
20,
14
]
]
},
"text-rotation-alignment": "map"
},
"paint": {
"text-color": "#fff",
"text-halo-color": "black",
"text-halo-width": 2
}
},
{
"id": "place_label_other",
"type": "symbol",
"source": "openmaptiles",
"source-layer": "place",
"minzoom": 8,
"filter": [
"all",
[
"!in",
"class",
"city",
"state",
"country",
"continent"
]
],
"layout": {
"text-field": "{name:latin}\n{name:nonlatin}",
"text-font": [
"Noto Sans Regular"
],
"text-max-width": 6,
"text-size": {
"stops": [
[
"==",
"$type",
"Point"
6,
10
],
[
"!in",
"class",
"city",
"state",
"country",
"continent"
12,
14
]
],
"layout": {
"text-field": "{name:latin}\n{name:nonlatin}",
"text-font": [
"Noto Sans Regular"
],
"text-max-width": 6,
"text-size": {
"stops": [
[
6,
10
],
[
12,
14
]
]
},
"visibility": "visible",
"text-anchor": "center"
},
"paint": {
"text-color": "#fff",
"text-halo-color": "black",
"text-halo-blur": 0,
"text-halo-width": 2
}
}
]
}
]
},
"visibility": "visible",
"text-anchor": "center"
},
"paint": {
"text-color": "#fff",
"text-halo-color": "black",
"text-halo-blur": 0,
"text-halo-width": 2
}
}
]
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment