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
e44cff46
Commit
e44cff46
authored
Oct 15, 2019
by
ncastejon
Browse files
Fix: replace the flyTo with panTo (mapbox gl js issue with flyTo and minZoom)
parent
396df0dd
Pipeline
#1763
passed with stages
in 7 minutes
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/app/geosource/models/data.model.ts
View file @
e44cff46
...
...
@@ -23,12 +23,4 @@ export class Data implements IData {
this
.
id
=
data
.
properties
.
gid
;
}
}
orderProperties
(
orderedProperties
:
string
[])
{
const
newDataPropertiesOrder
=
{};
orderedProperties
.
forEach
((
field
)
=>
{
newDataPropertiesOrder
[
field
]
=
this
.
properties
[
field
]
?
this
.
properties
[
field
]
:
''
;
});
this
.
properties
=
newDataPropertiesOrder
;
}
}
src/app/geosource/services/dataset-detail.service.ts
View file @
e44cff46
...
...
@@ -209,7 +209,7 @@ export class DatasetDetailService {
);
// Set the properties order based on the natural order from the data provider (set in 'dataset.fields.list')
this
.
_dataset
.
data
.
forEach
((
data
)
=>
{
data
.
orderProperties
(
this
.
_dataset
.
fields
.
list
);
this
.
orderProperties
(
data
,
this
.
_dataset
.
fields
.
list
);
});
}
});
...
...
@@ -218,6 +218,14 @@ export class DatasetDetailService {
}
}
orderProperties
(
data
:
any
,
orderedProperties
:
string
[])
{
const
newDataPropertiesOrder
=
{};
orderedProperties
.
forEach
((
field
)
=>
{
newDataPropertiesOrder
[
field
]
=
data
.
properties
[
field
]
?
data
.
properties
[
field
]
:
''
;
});
data
.
properties
=
newDataPropertiesOrder
;
}
get
datasetData
():
Data
[]
{
return
this
.
_dataset
.
data
;
}
...
...
src/app/map/services/map.service.ts
View file @
e44cff46
...
...
@@ -496,15 +496,15 @@ export class MapService {
const
pointCenter
=
selectedFeature
.
geometry
.
type
===
'
Point
'
?
selectedFeature
.
geometry
.
coordinates
:
centroid
(
selectedFeature
).
geometry
.
coordinates
;
this
.
_map
.
flyTo
({
center
:
pointCenter
,
curve
:
1
,
duration
:
500
,
this
.
_map
.
panTo
(
pointCenter
,
{
duration
:
500
,
// 70 is the width of the dataset data details panel divided by 4 (by 2 because the map and the table
// share the remaining space and again by 2 because we want to center the point so there is half on the
// left, half on the right)
offset
:
new
mapboxgl
.
Point
(
-
70
,
0
),
});
},
);
}
}
...
...
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