Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
web-et-numerique
web-et-numerique-internet
data.grandlyon.com
web-portal
components
custom-apps
web-app
Commits
7cb8107d
Commit
7cb8107d
authored
Oct 30, 2019
by
ncastejon
Browse files
Fix table-map display for ATMO providers.
parent
9d6c6432
Pipeline
#1791
passed with stages
in 6 minutes and 55 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/app/geosource/components/dataset-detail/dataset-map/dataset-map.component.ts
View file @
7cb8107d
...
...
@@ -79,13 +79,17 @@ export class DatasetMapComponent implements OnInit, OnDestroy {
this
.
mapOptions
.
vectorService
=
{
...
this
.
metadata
.
link
.
find
((
e
)
=>
{
return
e
.
service
===
linkFormats
.
wfs
;
})
};
this
.
mapOptions
.
rasterService
=
{
...
this
.
metadata
.
link
.
find
((
e
)
=>
{
return
e
.
service
===
linkFormats
.
wms
;
})
};
// For authentication reason, we do not use the open url of download.data for the WMS service.
// For authentication reason, we do not use the open url of download.data for the WMS service.
// We use a kong endpoint for the url to be proxyfied
if
(
!
this
.
mapOptions
.
rasterService
)
{
return
;
}
const
domain
=
this
.
mapOptions
.
rasterService
.
url
.
split
(
'
wms
'
)[
1
];
this
.
mapOptions
.
rasterService
.
url
=
APP_CONFIG
.
backendUrls
.
wms
+
domain
;
// If download data, use config url.
if
(
this
.
mapOptions
.
rasterService
.
url
.
includes
(
'
download.data
'
))
{
const
domain
=
this
.
mapOptions
.
rasterService
.
url
.
split
(
'
wms
'
)[
1
];
this
.
mapOptions
.
rasterService
.
url
=
APP_CONFIG
.
backendUrls
.
wms
+
domain
;
}
// If the data are just a sample, we will use this sample as geojson to display the interaction layer on the map.
// Otherwise we use normally the MVT service.
...
...
@@ -105,7 +109,7 @@ export class DatasetMapComponent implements OnInit, OnDestroy {
// Get bbox from the WMS service. If not exist, get it from metadata.
const
wmsLink
=
this
.
metadata
.
link
.
find
((
e
)
=>
{
return
e
.
service
===
linkFormats
.
wms
;
});
if
(
wmsLink
&&
wmsLink
.
bbox_by_projection
)
{
if
(
wmsLink
&&
wmsLink
.
bbox_by_projection
&&
wmsLink
.
bbox_by_projection
[
'
EPSG:4171
'
]
)
{
const
bbox
=
wmsLink
.
bbox_by_projection
[
'
EPSG:4171
'
];
this
.
mapOptions
.
bbox
=
[
bbox
[
'
miny
'
],
bbox
[
'
minx
'
],
bbox
[
'
maxy
'
],
bbox
[
'
maxx
'
]];
}
else
{
...
...
src/app/geosource/models/elasticsearch-options.model.ts
View file @
7cb8107d
...
...
@@ -129,7 +129,7 @@ export class ElasticsearchOptions {
// Known licences
get
knownLicences
()
{
return
[
'
Licence Ouverte
'
,
'
Licence
Engagée
'
,
'
Licence
Associée
'
];
return
[
'
Licence Ouverte
'
,
'
Licence
ODbL
'
,
'
Licence
de réutilisation des données d
\'
intérêt général
'
];
}
// Getters
...
...
src/app/map/services/map.service.ts
View file @
7cb8107d
...
...
@@ -123,27 +123,30 @@ export class MapService {
addLayers
()
{
this
.
addWMSLayer
();
// There is two ways to add tha data layers: from a geojson or from a MVT url
if
(
!
this
.
isMVT
)
{
if
(
this
.
geojson
)
{
this
.
_map
.
addSource
(
'
vector-source
'
,
{
type
:
'
geojson
'
,
data
:
this
.
geojson
,
});
this
.
addDataLayer
();
}
}
else
{
if
(
this
.
vectorService
&&
this
.
vectorService
.
url
)
{
const
domain
=
this
.
vectorService
.
url
.
split
(
'
wfs
'
)[
1
];
const
url
=
`
${
this
.
mvtUrl
}${
domain
}
?LAYERS`
+
`=
${
this
.
vectorService
.
name
}
&map.imagetype=mvt&tilemode=gmap&tile={x}+{y}+{z}&mode=tile`
;
this
.
_map
.
addSource
(
'
vector-source
'
,
{
type
:
'
vector
'
,
tiles
:
[
url
],
});
this
.
addDataLayer
();
// Add a geojson layer only if data from the metropole
if
(
this
.
rasterService
.
url
.
includes
(
'
download.data
'
))
{
// There is two ways to add tha data layers: from a geojson or from a MVT url
if
(
!
this
.
isMVT
)
{
if
(
this
.
geojson
)
{
this
.
_map
.
addSource
(
'
vector-source
'
,
{
type
:
'
geojson
'
,
data
:
this
.
geojson
,
});
this
.
addDataLayer
();
}
}
else
{
if
(
this
.
vectorService
&&
this
.
vectorService
.
url
)
{
const
domain
=
this
.
vectorService
.
url
.
split
(
'
wfs
'
)[
1
];
const
url
=
`
${
this
.
mvtUrl
}${
domain
}
?LAYERS`
+
`=
${
this
.
vectorService
.
name
}
&map.imagetype=mvt&tilemode=gmap&tile={x}+{y}+{z}&mode=tile`
;
this
.
_map
.
addSource
(
'
vector-source
'
,
{
type
:
'
vector
'
,
tiles
:
[
url
],
});
this
.
addDataLayer
();
}
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment