diff --git a/src/app/constant.js b/src/app/constant.js index e36eb9324..9186fbcc6 100644 --- a/src/app/constant.js +++ b/src/app/constant.js @@ -542,7 +542,22 @@ export const FONT_AWESOME_ICONS = { crop: "fas fa-crop-alt", exit: "fas fa-door-open", slider: "fas fa-sliders-h", + + /** + * @since 3.8.0 + */ bookmark: "fas fa-bookmark", + + /** + * @since 3.8.0 + */ + reply: "fas fa-reply", + + /** + * @since 3.8.0 + */ + share: "fas fa-share", + }; /** diff --git a/src/app/g3w-ol/controls/zoomhistorycontrol.js b/src/app/g3w-ol/controls/zoomhistorycontrol.js new file mode 100644 index 000000000..4bac12725 --- /dev/null +++ b/src/app/g3w-ol/controls/zoomhistorycontrol.js @@ -0,0 +1,26 @@ +import MapControlZoomHistory from "components/MapControlZoomHistory.vue"; + +const Control = require('g3w-ol/controls/control'); + +function ZoomHistoryControl() { + const vueElement = Vue.extend(MapControlZoomHistory); + Control.call(this, { + name: "zoomhistory", + tipLabel: "sdk.mapcontrols.addlayer.tooltip", + element: (new vueElement()).$mount().$el + }); +} + +ol.inherits(ZoomHistoryControl, Control); + +const proto = ZoomHistoryControl.prototype; + +proto.setMap = function(map) { + Control.prototype.setMap.call(this,map); +}; + +proto.layout = function(map) { + Control.prototype.layout.call(this, map); +}; + +module.exports = ZoomHistoryControl; diff --git a/src/app/gui/map/control/factory.js b/src/app/gui/map/control/factory.js index 8cf700801..9e7d5381e 100644 --- a/src/app/gui/map/control/factory.js +++ b/src/app/gui/map/control/factory.js @@ -15,6 +15,7 @@ const ScaleControl = require('g3w-ol/controls/scalecontrol'); const OnClikControl = require('g3w-ol/controls/onclickcontrol'); const ScreenshotControl = require('g3w-ol/controls/screenshotcontrol'); const geoScreenshotControl = require('g3w-ol/controls/geoscreenshotcontrol'); +const ZoomHistoryControl = require('g3w-ol/controls/zoomhistorycontrol'); const QueryByDrawPolygonControl = require('g3w-ol/controls/querybydrawpolygoncontrol'); @@ -37,7 +38,6 @@ ControlsFactory.CONTROLS = { 'zoom': OLControl, 'scaleline': OLControl, 'overview': OLControl, - 'nominatim': GeocodingControl, // temporary fro backward compatibility 'geocoding': GeocodingControl, 'addlayers': AddLayersControl, 'length': LengthControl, @@ -47,7 +47,18 @@ ControlsFactory.CONTROLS = { 'onclick': OnClikControl, 'screenshot': ScreenshotControl, 'geoscreenshot': geoScreenshotControl, - 'querybydrawpolygon': QueryByDrawPolygonControl + 'querybydrawpolygon': QueryByDrawPolygonControl, + + /** + * @since 3.8.0 + */ + 'zoomhistory': ZoomHistoryControl, + + /** + * @deprecated since version ??. Will be removed in version ??. Use 'geocoding' control instead. + */ + 'nominatim': GeocodingControl, + }; module.exports = ControlsFactory; diff --git a/src/app/gui/map/mapservice.js b/src/app/gui/map/mapservice.js index 1edc61188..25e92a293 100644 --- a/src/app/gui/map/mapservice.js +++ b/src/app/gui/map/mapservice.js @@ -893,6 +893,14 @@ proto._setupControls = function() { }); } break; + /** + * @since 3.8.0 + */ + case 'zoomhistory': + control = this.createMapControl(controlType, { add: false }); + this._addControlToMapControlsLeftBottom(control); + break; + } }); return this.getMapControls() @@ -1173,6 +1181,16 @@ proto._addControlToMapControls = function(control, visible=true) { $('.g3w-map-controls').append(controlElement); }; +/** + * @since 3.8.0 + */ +proto._addControlToMapControlsLeftBottom = function(control, visible=true) { + if (!visible) { + control.element.style.display = "none"; + } + $('.g3w-map-controls-left-bottom').append(control.element); +}; + proto.getMapControlByType = function({type}={}) { const mapControl = this._mapControls.find(mapControl => type === mapControl.type); return mapControl && mapControl.control; diff --git a/src/components/Map.vue b/src/components/Map.vue index b8a78627b..c1804bf15 100644 --- a/src/components/Map.vue +++ b/src/components/Map.vue @@ -9,16 +9,38 @@