From 71144ecf2837059be55ba31f497ab92bb33b0049 Mon Sep 17 00:00:00 2001 From: Pekka Helesuo Date: Thu, 31 Oct 2024 12:03:17 +0200 Subject: [PATCH] move zoombar tool under mapmodule --- .../publisher2/resources/locale/en.js | 1 - .../publisher2/resources/locale/fi.js | 1 - .../publisher2/resources/locale/fr.js | 1 - .../publisher2/resources/locale/is.js | 1 - .../publisher2/resources/locale/ru.js | 1 - .../publisher2/resources/locale/sv.js | 1 - .../framework/publisher2/tools/ZoombarTool.js | 43 --------------- .../plugin/zoombar/publisher/ZoombarTool.js | 55 +++++++++++++++++++ bundles/mapping/mapmodule/publisher/tools.js | 3 +- .../mapping/mapmodule/resources/locale/en.js | 5 +- .../mapping/mapmodule/resources/locale/fi.js | 3 + .../mapping/mapmodule/resources/locale/fr.js | 5 +- .../mapping/mapmodule/resources/locale/is.js | 5 +- .../mapping/mapmodule/resources/locale/ru.js | 7 ++- .../mapping/mapmodule/resources/locale/sv.js | 5 +- .../framework/bundle/publisher2/bundle.js | 4 -- 16 files changed, 82 insertions(+), 59 deletions(-) delete mode 100755 bundles/framework/publisher2/tools/ZoombarTool.js create mode 100644 bundles/mapping/mapmodule/plugin/zoombar/publisher/ZoombarTool.js diff --git a/bundles/framework/publisher2/resources/locale/en.js b/bundles/framework/publisher2/resources/locale/en.js index a23ee24e89..9c0f1d945f 100755 --- a/bundles/framework/publisher2/resources/locale/en.js +++ b/bundles/framework/publisher2/resources/locale/en.js @@ -66,7 +66,6 @@ Oskari.registerLocalization( "tooltip": "Select available map tools. Check a placement in the map preview.", "AnnouncementsPlugin": "Announcements", "TimeseriesControlPlugin": "Time series player", - "Portti2Zoombar": "Zoom bar", "ControlsPlugin": "Pan by mouse", "SearchPlugin": "Place search", "FeaturedataPlugin": "Feature data", diff --git a/bundles/framework/publisher2/resources/locale/fi.js b/bundles/framework/publisher2/resources/locale/fi.js index a094cd76ec..263d3a630d 100755 --- a/bundles/framework/publisher2/resources/locale/fi.js +++ b/bundles/framework/publisher2/resources/locale/fi.js @@ -66,7 +66,6 @@ Oskari.registerLocalization( "tooltip": "Valitse kartalla käytettävissä olevat työkalut. Tarkista asettelu esikatselukartasta.", "AnnouncementsPlugin": "Ilmoitukset", "TimeseriesControlPlugin": "Aikasarjatoistin", - "Portti2Zoombar": "Mittakaavasäädin", "ControlsPlugin": "Kartan liikuttaminen hiirellä raahaamalla", "SearchPlugin": "Osoite- ja paikannimihaku", "FeaturedataPlugin": "Kohdetietotaulukko", diff --git a/bundles/framework/publisher2/resources/locale/fr.js b/bundles/framework/publisher2/resources/locale/fr.js index 3b2f009e48..01b613a827 100644 --- a/bundles/framework/publisher2/resources/locale/fr.js +++ b/bundles/framework/publisher2/resources/locale/fr.js @@ -63,7 +63,6 @@ Oskari.registerLocalization( "label": "Outils", "tooltip": "Sélectionner les outils de carte accessibles. Consulter une mise en place dans la prévisualisation de carte.", "TimeseriesControlPlugin": "Lecteur chronologique", - "Portti2Zoombar": "Barre de zoom", "ControlsPlugin": "Panoramiser avec la souris", "SearchPlugin": "Recherche de lieu", "FeaturedataPlugin": "Données de fonctionnalité", diff --git a/bundles/framework/publisher2/resources/locale/is.js b/bundles/framework/publisher2/resources/locale/is.js index 748b15ae9c..669bd89381 100755 --- a/bundles/framework/publisher2/resources/locale/is.js +++ b/bundles/framework/publisher2/resources/locale/is.js @@ -50,7 +50,6 @@ Oskari.registerLocalization( "maptools": { "label": "Tól", "tooltip": "Velja tiltæk kortatól. Athugaðu staðsetningu við forskoðun korts.", - "Portti2Zoombar": "Þysjunarstika", "ControlsPlugin": "Hliðra með mús", "SearchPlugin": "Leit eftir stað", "FeaturedataPlugin": "Fitjugögn", diff --git a/bundles/framework/publisher2/resources/locale/ru.js b/bundles/framework/publisher2/resources/locale/ru.js index 6ef8cf7d5b..07a5cca9db 100644 --- a/bundles/framework/publisher2/resources/locale/ru.js +++ b/bundles/framework/publisher2/resources/locale/ru.js @@ -64,7 +64,6 @@ Oskari.registerLocalization( "label": "Инструменты", "tooltip": "Выберите доступные инструменты карты. Проверка размещения в окне предварительного просмотра карты.", "TimeseriesControlPlugin": "Временные ряды", - "Portti2Zoombar": "Панель увеличения", "ControlsPlugin": "Панорамирование мышью", "SearchPlugin": "Поиск места", "FeaturedataPlugin": "Данные объекта", diff --git a/bundles/framework/publisher2/resources/locale/sv.js b/bundles/framework/publisher2/resources/locale/sv.js index 5c48697e10..4eeb46093a 100755 --- a/bundles/framework/publisher2/resources/locale/sv.js +++ b/bundles/framework/publisher2/resources/locale/sv.js @@ -66,7 +66,6 @@ Oskari.registerLocalization( "tooltip": "Välj verktygen som visas på kartan. Du kan se deras placering på den förhandsvisade kartan.", "AnnouncementsPlugin": "Aviseringar", "TimeseriesControlPlugin": "Tidseriespelare", - "Portti2Zoombar": "Skalans glidreglage", "ControlsPlugin": "Flytta kartvyn med musen", "SearchPlugin": "Adress- och ortnamnssökning", "FeaturedataPlugin": "Objektuppgifter", diff --git a/bundles/framework/publisher2/tools/ZoombarTool.js b/bundles/framework/publisher2/tools/ZoombarTool.js deleted file mode 100755 index 9da571004d..0000000000 --- a/bundles/framework/publisher2/tools/ZoombarTool.js +++ /dev/null @@ -1,43 +0,0 @@ -Oskari.clazz.define('Oskari.mapframework.publisher.tool.ZoombarTool', - function () { - }, { - index: 3, - - /** - * Get tool object. - * @method getTool - * - * @returns {Object} tool description - */ - getTool: function () { - return { - id: 'Oskari.mapframework.bundle.mapmodule.plugin.Portti2Zoombar', - title: 'Portti2Zoombar', - config: this.state.pluginConfig || {} - }; - }, - /** - * Get values. - * @method getValues - * @public - * - * @returns {Object} tool value object - */ - getValues: function () { - if (!this.isEnabled()) { - return null; - } - return { - configuration: { - mapfull: { - conf: { - plugins: [{ id: this.getTool().id, config: this.getPlugin().getConfig() }] - } - } - } - }; - } - }, { - 'extend': ['Oskari.mapframework.publisher.tool.AbstractPluginTool'], - 'protocol': ['Oskari.mapframework.publisher.Tool'] - }); diff --git a/bundles/mapping/mapmodule/plugin/zoombar/publisher/ZoombarTool.js b/bundles/mapping/mapmodule/plugin/zoombar/publisher/ZoombarTool.js new file mode 100644 index 0000000000..6c37003c1d --- /dev/null +++ b/bundles/mapping/mapmodule/plugin/zoombar/publisher/ZoombarTool.js @@ -0,0 +1,55 @@ +import { AbstractPublisherTool } from '../../../../../framework/publisher2/tools/AbstractPublisherTool'; + +class ZoombarTool extends AbstractPublisherTool { + constructor (...args) { + super(...args); + this.index = 1; + this.group = 'additional'; + }; + + /** + * Get tool object. + * @method getTool + * + * @returns {Object} tool description + */ + getTool () { + return { + id: 'Oskari.mapframework.bundle.mapmodule.plugin.Portti2Zoombar', + title: Oskari.getMsg('MapModule', 'publisherTools.Zoombar.toolLabel'), + config: this.state.pluginConfig || {} + }; + }; + + /** + * Get values. + * @method getValues + * @public + * + * @returns {Object} tool value object + */ + getValues () { + if (!this.isEnabled()) { + return null; + } + return { + configuration: { + mapfull: { + conf: { + plugins: [{ id: this.getTool().id, config: this.getPlugin().getConfig() }] + } + } + } + }; + }; +} + +// Attach protocol to make this discoverable by Oskari publisher +Oskari.clazz.defineES('Oskari.publisher.ZoombarTool', + ZoombarTool, + { + protocol: ['Oskari.mapframework.publisher.Tool'] + } +); + +export { ZoombarTool }; diff --git a/bundles/mapping/mapmodule/publisher/tools.js b/bundles/mapping/mapmodule/publisher/tools.js index f099a2e41a..3cb7517c52 100644 --- a/bundles/mapping/mapmodule/publisher/tools.js +++ b/bundles/mapping/mapmodule/publisher/tools.js @@ -6,5 +6,6 @@ import { ScaleBarTool } from '../plugin/scalebar/publisher/ScalebarTool'; import { MyLocationTool } from '../plugin/mylocation/publisher/MyLocationTool'; import { PanButtonsTool } from '../plugin/panbuttons/publisher/PanButtonsTool'; import { IndexMapTool } from '../plugin/indexmap/publisher/IndexMapTool'; +import { ZoombarTool } from '../plugin/zoombar/publisher/ZoombarTool'; -export { LogoTool, ScaleBarTool, MyLocationTool, PanButtonsTool, IndexMapTool }; +export { LogoTool, ScaleBarTool, MyLocationTool, PanButtonsTool, IndexMapTool, ZoombarTool }; diff --git a/bundles/mapping/mapmodule/resources/locale/en.js b/bundles/mapping/mapmodule/resources/locale/en.js index 873c493890..9cac9fbf87 100755 --- a/bundles/mapping/mapmodule/resources/locale/en.js +++ b/bundles/mapping/mapmodule/resources/locale/en.js @@ -180,7 +180,10 @@ Oskari.registerLocalization( }, "IndexMapPlugin": { "toolLabel": "Index map", - } + }, + "Zoombar": { + "toolLabel": "Zoom bar" + }, } } }); \ No newline at end of file diff --git a/bundles/mapping/mapmodule/resources/locale/fi.js b/bundles/mapping/mapmodule/resources/locale/fi.js index d0944b86e7..cc0238f0ef 100755 --- a/bundles/mapping/mapmodule/resources/locale/fi.js +++ b/bundles/mapping/mapmodule/resources/locale/fi.js @@ -180,6 +180,9 @@ Oskari.registerLocalization( }, "IndexMapPlugin": { "toolLabel": "Indeksikartta" + }, + "Zoombar": { + "toolLabel": "Mittakaavasäädin" } } } diff --git a/bundles/mapping/mapmodule/resources/locale/fr.js b/bundles/mapping/mapmodule/resources/locale/fr.js index 9d27f9aacb..8d32d0b5e3 100755 --- a/bundles/mapping/mapmodule/resources/locale/fr.js +++ b/bundles/mapping/mapmodule/resources/locale/fr.js @@ -148,7 +148,10 @@ Oskari.registerLocalization( }, "IndexMapPlugin": { "toolLabel": "Carte-index" - } + }, + "Zoombar": { + "toolLabel": "Barre de zoom" + }, } } }); diff --git a/bundles/mapping/mapmodule/resources/locale/is.js b/bundles/mapping/mapmodule/resources/locale/is.js index 7642578f68..d2e485e655 100755 --- a/bundles/mapping/mapmodule/resources/locale/is.js +++ b/bundles/mapping/mapmodule/resources/locale/is.js @@ -142,7 +142,10 @@ Oskari.registerLocalization( }, "IndexMapPlugin": { "toolLabel": "Index kort" - } + }, + "Zoombar": { + "toolLabel": "Þysjunarstika" + }, } } }); diff --git a/bundles/mapping/mapmodule/resources/locale/ru.js b/bundles/mapping/mapmodule/resources/locale/ru.js index 64dd62c234..102f3226a7 100644 --- a/bundles/mapping/mapmodule/resources/locale/ru.js +++ b/bundles/mapping/mapmodule/resources/locale/ru.js @@ -141,7 +141,12 @@ Oskari.registerLocalization( "PanButtons": { "toolLabel": "Инструмент панорамирования" }, - "IndexMapPlugin": "Номенклатура карты", + "IndexMapPlugin": { + "toolLabel": "Номенклатура карты" + }, + "Zoombar": { + "toolLabel": "Панель увеличения" + }, } } }); diff --git a/bundles/mapping/mapmodule/resources/locale/sv.js b/bundles/mapping/mapmodule/resources/locale/sv.js index d1ec24d9bc..23f12e7324 100755 --- a/bundles/mapping/mapmodule/resources/locale/sv.js +++ b/bundles/mapping/mapmodule/resources/locale/sv.js @@ -175,7 +175,10 @@ Oskari.registerLocalization( }, "IndexMapPlugin": { "toolLabel": "Indexkarta" - } + }, + "Zoombar": { + "toolLabel": "Skalans glidreglage" + }, } } }); \ No newline at end of file diff --git a/packages/framework/bundle/publisher2/bundle.js b/packages/framework/bundle/publisher2/bundle.js index e52d98dc60..63a70ad648 100755 --- a/packages/framework/bundle/publisher2/bundle.js +++ b/packages/framework/bundle/publisher2/bundle.js @@ -97,10 +97,6 @@ Oskari.clazz.define("Oskari.mapframework.bundle.publisher2.PublisherBundle", fun "type": "text/javascript", "src": "../../../../bundles/framework/publisher2/tools/ToolbarTool.js" }, - { - "type": "text/javascript", - "src": "../../../../bundles/framework/publisher2/tools/ZoombarTool.js" - }, { "type": "text/javascript", "src": "../../../../bundles/framework/publisher2/tools/SearchTool.js"