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
e5a9683a
Commit
e5a9683a
authored
Aug 19, 2019
by
ncastejon
Browse files
Remove deepclone to display the feature details into the panel.
parent
52efa409
Changes
1
Show whitespace changes
Inline
Side-by-side
src/app/map/services/map.service.ts
View file @
e5a9683a
...
...
@@ -149,6 +149,7 @@ export class MapService {
addClickEventOnLayer
(
layer
:
string
)
{
this
.
_map
.
on
(
'
click
'
,
layer
,
(
e
)
=>
{
this
.
selectedFeature
=
e
.
features
[
0
].
id
;
// Reset the hover and highglithed state for the current and previous feature
this
.
changeFeatureState
(
this
.
hoveredFeatureId
,
{
highlight
:
false
});
...
...
@@ -160,12 +161,7 @@ export class MapService {
const
feature
=
e
.
features
[
0
];
this
.
handleMapPosition
(
e
.
point
.
x
,
e
.
lngLat
,
()
=>
{
const
featureCloned
=
cloneDeep
(
feature
);
// Remove the generated id from the properties to be displayed
delete
featureCloned
.
id
;
this
.
_panelState
.
next
({
state
:
true
,
properties
:
featureCloned
.
properties
});
this
.
_panelState
.
next
({
state
:
true
,
properties
:
feature
.
properties
});
});
});
}
...
...
@@ -440,16 +436,9 @@ export class MapService {
}
closePanel
()
{
this
.
changeFeatureState
(
this
.
highlightedFeatureId
,
{
highlight
:
false
});
this
.
selectedFeature
=
null
;
if
(
this
.
_map
.
getLayer
(
'
polygon-features-highlight
'
))
{
this
.
_map
.
setLayoutProperty
(
'
polygon-features-highlight
'
,
'
visibility
'
,
'
none
'
);
}
if
(
this
.
_map
.
getLayer
(
'
line-features-highlight
'
))
{
this
.
_map
.
setLayoutProperty
(
'
line-features-highlight
'
,
'
visibility
'
,
'
none
'
);
}
if
(
this
.
_map
.
getLayer
(
'
unclustered-point-highlighted
'
))
{
this
.
_map
.
setLayoutProperty
(
'
unclustered-point-highlighted
'
,
'
visibility
'
,
'
none
'
);
}
this
.
highlightedFeatureId
=
null
;
this
.
_panelState
.
next
({
state
:
false
});
}
...
...
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