diff --git a/icons/zoom.svg b/icons/zoom.svg new file mode 100755 index 000000000..6265ddf42 --- /dev/null +++ b/icons/zoom.svg @@ -0,0 +1,60 @@ + + + + + + + + image/svg+xml + + uniE003 + + + + + + uniE003 + + diff --git a/plugins/LayerTree.jsx b/plugins/LayerTree.jsx index 7760d47d0..8afc994cf 100644 --- a/plugins/LayerTree.jsx +++ b/plugins/LayerTree.jsx @@ -17,7 +17,7 @@ const FileSaver = require('file-saver'); const Message = require('../components/I18N/Message'); const {LayerRole, changeLayerProperty, removeLayer, reorderLayer, setSwipe, addLayerSeparator} = require('../actions/layers') const {setActiveLayerInfo} = require('../actions/layerinfo'); -const {toggleMapTips} = require('../actions/map'); +const {toggleMapTips, zoomToExtent} = require('../actions/map'); const ConfigUtils = require("../utils/ConfigUtils"); const LocaleUtils = require("../utils/LocaleUtils"); const Icon = require('../components/Icon'); @@ -232,9 +232,17 @@ class LayerTree extends React.Component { ( this.props.reorderLayer(layer, path, -1)} />) ]; } + let zoomToLayerButton = null; + if(sublayer.bbox && sublayer.bbox.bounds && sublayer.bbox.crs) { + let zoomToLayerTooltip = LocaleUtils.getMessageById(this.context.messages, "layertree.zoomtolayer"); + zoomToLayerButton = ( + this.props.zoomToExtent(sublayer.bbox.bounds, sublayer.bbox.crs)} /> + ) + } editframe = (
+ {zoomToLayerButton} this.layerTransparencyChanged(layer, path, ev.target.value)} onTouchEnd={(ev) => this.layerTransparencyChanged(layer, path, ev.target.value)} /> {reorderButtons} diff --git a/translations/data.de-DE b/translations/data.de-DE index 6dfa85395..a8d7541c9 100644 --- a/translations/data.de-DE +++ b/translations/data.de-DE @@ -102,7 +102,8 @@ "deletealllayers": "Alle Ebenen entfernen", "visiblefilter": "Unsichtbare Ebenen filtern", "separator": "Separator", - "separatortooltip": "Separator hinzufügen" + "separatortooltip": "Separator hinzufügen", + "zoomtolayer": "Auf den Layer zoomen" }, "locate": { "metersUnit": "Meter", diff --git a/translations/data.en-US b/translations/data.en-US index 827bda87a..7d102700f 100644 --- a/translations/data.en-US +++ b/translations/data.en-US @@ -102,7 +102,8 @@ "deletealllayers": "Remove all layers", "visiblefilter": "Filter invisible layers", "separator": "Separator", - "separatortooltip": "Add separator" + "separatortooltip": "Add separator", + "zoomtolayer": "Zoom to layer" }, "locate": { "metersUnit": "meters", diff --git a/translations/tsconfig.json b/translations/tsconfig.json index 73271349d..dac91fe2c 100644 --- a/translations/tsconfig.json +++ b/translations/tsconfig.json @@ -90,6 +90,7 @@ "layertree.visiblefilter", "layertree.separator", "layertree.separatortooltip", + "layertree.zoomtolayer", "locate.metersUnit", "locate.feetUnit", "locate.popup",