Skip to content

Commit

Permalink
Fixed #31
Browse files Browse the repository at this point in the history
  • Loading branch information
claustres committed Dec 19, 2018
1 parent 61380a1 commit c23137f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/i18n/app_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"VIGICRUES_LEVEL_4": "Major flood risk",
"REMOVE_LABEL": "$t(REMOVE_LABEL)",
"REMOVE_DIALOG_TITLE": "Remove {{layer}} ?",
"REMOVE_DIALOG_MESSAGE": "Are you sure you want to remove <b>{{layer}}</b> from your workspace ?"
"REMOVE_DIALOG_MESSAGE": "Are you sure you want to remove <b>{{layer}}</b> from your workspace ?",
"ZOOM_TO_LABEL": "Zoom to"
},
"MapActivity": {
"TOGGLE_FULLSCREEN": "Fullscreen",
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/app_fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"VIGICRUES_LEVEL_4": "Risque de crue majeure",
"REMOVE_LABEL": "$t(REMOVE_LABEL)",
"REMOVE_DIALOG_TITLE": "Supprimer {{layer}} ?",
"REMOVE_DIALOG_MESSAGE": "Etes vous sûr de vouloier supprimer {{layer}} de votre espace de travail ?"
"REMOVE_DIALOG_MESSAGE": "Etes vous sûr de vouloier supprimer {{layer}} de votre espace de travail ?",
"ZOOM_TO_LABEL": "Zoomer sur"
},
"MapActivity": {
"TOGGLE_FULLSCREEN": "Plein écran",
Expand Down
10 changes: 9 additions & 1 deletion src/mixins/mixin.activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default {
this.layers = {}
this.layerHandlers = {
toggle: (layer) => this.onTriggerLayer(layer),
zoomTo: (layer) => this.onZoomToLayer(layer),
remove: (layer) => this.onRemoveLayer(layer)
}
const catalogService = this.$api.getService('catalog')
Expand All @@ -29,9 +30,13 @@ export default {
})
},
onLayerAdded (layer) {
// FIXME: Add supported actions
// Add supported actions
if (layer.type === 'OverlayLayer') {
layer.actions = [{
name: 'zoomTo',
label: this.$t('Activity.ZOOM_TO_LABEL'),
icon: 'remove_circle'
}, {
name: 'remove',
label: this.$t('Activity.REMOVE_LABEL'),
icon: 'remove_circle'
Expand All @@ -45,6 +50,9 @@ export default {
this.hideLayer(layer.name)
}
},
onZoomToLayer (layer) {
this.zoomToLayer(layer.name)
},
onRemoveLayer (layer) {
Dialog.create({
title: this.$t('Activity.REMOVE_DIALOG_TITLE', { layer: layer.name }),
Expand Down

0 comments on commit c23137f

Please sign in to comment.