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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GéoContrib
Géocontrib Frontend
Commits
9e525eb1
Commit
9e525eb1
authored
Oct 11, 2022
by
Timothee P
Browse files
Options
Downloads
Patches
Plain Diff
block edit on double click for multi geometry
parent
545b154c
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!500
REDMINE_ISSUE-14954| Désactiver l'édition de la géométrie dans le cas des géométries multiples
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/services/edition-service.js
+2
-10
2 additions, 10 deletions
src/services/edition-service.js
src/views/Feature/FeatureEdit.vue
+6
-2
6 additions, 2 deletions
src/views/Feature/FeatureEdit.vue
with
8 additions
and
12 deletions
src/services/edition-service.js
+
2
−
10
View file @
9e525eb1
...
@@ -66,7 +66,7 @@ const editionService = {
...
@@ -66,7 +66,7 @@ const editionService = {
mapService
.
fitExtent
(
buffer
(
this
.
drawSource
.
getExtent
(),
200
));
mapService
.
fitExtent
(
buffer
(
this
.
drawSource
.
getExtent
(),
200
));
},
},
addEditionControls
(
geomType
)
{
addEditionControls
(
geomType
,
isEditable
)
{
this
.
geom_type
=
geomType
;
this
.
geom_type
=
geomType
;
this
.
drawSource
=
new
VectorSource
();
this
.
drawSource
=
new
VectorSource
();
this
.
drawnItems
=
new
VectorLayer
({
this
.
drawnItems
=
new
VectorLayer
({
...
@@ -150,12 +150,6 @@ const editionService = {
...
@@ -150,12 +150,6 @@ const editionService = {
features
:
this
.
selectForUpdate
.
getFeatures
()
features
:
this
.
selectForUpdate
.
getFeatures
()
});
});
// je garde ce bout de code pour l'implementation a venir du snapping
//snapping
// var snap = new Snap({
// source: this.drawSource
//});
// This workaround allows to avoid the ol freeze
// This workaround allows to avoid the ol freeze
// referenced bug : https://github.com/openlayers/openlayers/issues/6310
// referenced bug : https://github.com/openlayers/openlayers/issues/6310
// May be corrected in a future version
// May be corrected in a future version
...
@@ -168,10 +162,8 @@ const editionService = {
...
@@ -168,10 +162,8 @@ const editionService = {
}
}
};
};
mapService
.
getMap
().
addInteraction
(
this
.
selectForUpdate
);
if
(
isEditable
)
mapService
.
getMap
().
addInteraction
(
this
.
selectForUpdate
);
// disable edit on double-click if edition is disabled
mapService
.
getMap
().
addInteraction
(
this
.
modify
);
mapService
.
getMap
().
addInteraction
(
this
.
modify
);
// je garde ce bout de code pour l'implementation a venir du snapping
//map.addInteraction(snap);
},
},
resetAllTools
()
{
resetAllTools
()
{
if
(
this
.
draw
)
{
if
(
this
.
draw
)
{
...
...
...
...
This diff is collapsed.
Click to expand it.
src/views/Feature/FeatureEdit.vue
+
6
−
2
View file @
9e525eb1
...
@@ -266,7 +266,7 @@
...
@@ -266,7 +266,7 @@
<SidebarLayers
v-if=
"basemaps && map"
/>
<SidebarLayers
v-if=
"basemaps && map"
/>
<EditingToolbar
<EditingToolbar
v-if=
"
basemaps && map && (feature_type && !feature_type.geom_type.includes('multi'))
"
v-if=
"
isEditable
"
:map=
"map"
:map=
"map"
/>
/>
</div>
</div>
...
@@ -521,6 +521,10 @@ export default {
...
@@ -521,6 +521,10 @@ export default {
}
}
return
[];
return
[];
},
},
isEditable
()
{
return
this
.
basemaps
&&
this
.
map
&&
(
this
.
feature_type
&&
!
this
.
feature_type
.
geom_type
.
includes
(
'
multi
'
));
}
},
},
watch
:
{
watch
:
{
...
@@ -890,7 +894,7 @@ export default {
...
@@ -890,7 +894,7 @@ export default {
onFeatureTypeLoaded
()
{
onFeatureTypeLoaded
()
{
const
geomType
=
this
.
feature_type
.
geom_type
;
const
geomType
=
this
.
feature_type
.
geom_type
;
editionService
.
addEditionControls
(
geomType
);
editionService
.
addEditionControls
(
geomType
,
this
.
isEditable
);
editionService
.
draw
.
on
(
'
drawend
'
,
(
evt
)
=>
{
editionService
.
draw
.
on
(
'
drawend
'
,
(
evt
)
=>
{
const
feature
=
evt
.
feature
;
const
feature
=
evt
.
feature
;
this
.
updateGeomField
(
new
GeoJSON
().
writeGeometry
(
feature
.
getGeometry
(),{
dataProjection
:
'
EPSG:4326
'
,
featureProjection
:
'
EPSG:3857
'
}));
this
.
updateGeomField
(
new
GeoJSON
().
writeGeometry
(
feature
.
getGeometry
(),{
dataProjection
:
'
EPSG:4326
'
,
featureProjection
:
'
EPSG:3857
'
}));
...
...
...
...
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