Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Géocontrib Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GéoContrib
Géocontrib Frontend
Commits
bb48f42f
Commit
bb48f42f
authored
3 years ago
by
Timothee P
Browse files
Options
Downloads
Patches
Plain Diff
use default basemaps for project_details
parent
b3352973
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!295
Version 3.0.0
,
!285
REDMINE_ISSUE-12846
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/store/modules/map.store.js
+2
-28
2 additions, 28 deletions
src/store/modules/map.store.js
with
2 additions
and
28 deletions
src/store/modules/map.store.js
+
2
−
28
View file @
bb48f42f
...
@@ -104,8 +104,7 @@ const map = {
...
@@ -104,8 +104,7 @@ const map = {
});
});
},
},
INITIATE_MAP
({
state
,
rootState
,
commit
},
el
)
{
INITIATE_MAP
({
commit
},
el
)
{
//! since this function is not anymore called in different components, it would better to move it in project_details.vue
const
project
=
rootState
.
projects
.
project
;
let
mapDefaultViewCenter
=
[
46
,
2
];
// defaultMapView.center;
let
mapDefaultViewCenter
=
[
46
,
2
];
// defaultMapView.center;
let
mapDefaultViewZoom
=
5
;
// defaultMapView.zoom;
let
mapDefaultViewZoom
=
5
;
// defaultMapView.zoom;
mapUtil
.
createMap
(
el
,
{
mapUtil
.
createMap
(
el
,
{
...
@@ -114,33 +113,8 @@ const map = {
...
@@ -114,33 +113,8 @@ const map = {
});
});
commit
(
'
SET_MAP
'
,
mapUtil
.
getMap
());
commit
(
'
SET_MAP
'
,
mapUtil
.
getMap
());
// Load the layers.
// - if one basemap exists, check in the localstorage if one active basemap is set
// - if no current active basemap, get the first index
// - if not, load the default map and service options
let
layersToLoad
=
null
;
if
(
state
.
basemaps
&&
state
.
basemaps
.
length
>
0
)
{
// Use active one if exists, otherwise index 0 (first basemap in the list)
const
mapOptions
=
JSON
.
parse
(
localStorage
.
getItem
(
'
geocontrib-map-options
'
))
||
{};
const
basemapIndex
=
mapOptions
&&
mapOptions
[
project
]
&&
mapOptions
[
project
][
'
current-basemap-index
'
]
?
mapOptions
[
project
][
'
current-basemap-index
'
]
:
0
;
layersToLoad
=
state
.
basemaps
[
basemapIndex
].
layers
;
layersToLoad
.
forEach
((
layerToLoad
)
=>
{
state
.
availableLayers
.
forEach
((
layer
)
=>
{
if
(
layer
.
id
===
layerToLoad
.
id
)
{
layerToLoad
=
Object
.
assign
(
layerToLoad
,
layer
);
}
});
});
layersToLoad
.
reverse
();
}
mapUtil
.
addLayers
(
mapUtil
.
addLayers
(
layersToLoad
,
null
,
this
.
state
.
configuration
.
DEFAULT_BASE_MAP_SERVICE
,
this
.
state
.
configuration
.
DEFAULT_BASE_MAP_SERVICE
,
this
.
state
.
configuration
.
DEFAULT_BASE_MAP_OPTIONS
,
this
.
state
.
configuration
.
DEFAULT_BASE_MAP_OPTIONS
,
this
.
state
.
configuration
.
DEFAULT_BASE_MAP_SCHEMA_TYPE
,
this
.
state
.
configuration
.
DEFAULT_BASE_MAP_SCHEMA_TYPE
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment