Skip to content

Commit

Permalink
time controls 3d es-class
Browse files Browse the repository at this point in the history
  • Loading branch information
DenverCoder544 committed Nov 25, 2024
1 parent 2dd1e66 commit b6d1453
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 45 deletions.
1 change: 0 additions & 1 deletion bundles/framework/publisher2/resources/locale/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ Oskari.registerLocalization(
"LayerSelectionPlugin": "Map layers menu",
"MapLegend": "Show map legend",
"MapRotator": "Enable map rotation",
"TimeControl3d": "Time control",
"toolbarToolNames": {
"history": "Move to previous or next view",
"history_back": "Move to previous view",
Expand Down
1 change: 0 additions & 1 deletion bundles/framework/publisher2/resources/locale/fi.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ Oskari.registerLocalization(
"LayerSelectionPlugin": "Karttatasovalikko",
"MapLegend": "Näytä karttaselitteet",
"MapRotator": "Salli kartan pyörittäminen",
"TimeControl3d": "Ajanhetken säädin",
"toolbarToolNames": {
"history": "Siirtyminen edelliseen ja seuraavaan näkymään",
"history_back": "Siirtyminen edelliseen näkymään",
Expand Down
1 change: 0 additions & 1 deletion bundles/framework/publisher2/resources/locale/sv.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ Oskari.registerLocalization(
"LayerSelectionPlugin": "Kartlagermeny",
"MapLegend": "Visa kartförklaringen",
"MapRotator": "Tillåt kartrotation",
"TimeControl3d": "Tidskontroll",
"toolbarToolNames": {
"history": "Gå bakåt eller framåt",
"history_back": "Gå bakåt",
Expand Down
3 changes: 3 additions & 0 deletions bundles/mapping/time-control-3d/resources/locale/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Oskari.registerLocalization(
"slow": "Slow",
"normal": "Normal",
"fast": "Fast"
},
"publisher": {
"toolLabel": "Time control"
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions bundles/mapping/time-control-3d/resources/locale/fi.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Oskari.registerLocalization(
"slow": "Hidas",
"normal": "Normaali",
"fast": "Nopea"
},
"publisher": {
"toolLabel": "Ajanhetken säädin"
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions bundles/mapping/time-control-3d/resources/locale/sv.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Oskari.registerLocalization(
"slow": "Långsam",
"normal": "Normal",
"fast": "Snabb"
},
"publisher": {
"toolLabel": "Tidskontroll"
}
}
}
Expand Down
97 changes: 55 additions & 42 deletions bundles/mapping/time-control-3d/tool/TimeControl3dTool.js
Original file line number Diff line number Diff line change
@@ -1,46 +1,59 @@
Oskari.clazz.define('Oskari.mapping.time-control-3d.TimeControl3dTool',
function () {
}, {
index: 2,
lefthanded: 'top left',
righthanded: 'top right',
groupedSiblings: true,
/**
* Get tool object.
* @method getTool
*
* @returns {Object} tool description
*/
getTool: function () {
import { AbstractPublisherTool } from '../../../framework/publisher2/tools/AbstractPublisherTool';

class TimeControl3dTool extends AbstractPublisherTool {
constructor (...args) {
super(...args);
this.index = 180;
this.group = 'tools';
this.lefthanded = 'top left';
this.righthanded = 'top right';
this.groupedSiblings = true;
};

/**
* Get tool object.
* @method getTool
*
* @returns {Object} tool description
*/
getTool () {
return {
id: 'Oskari.mapping.time-control-3d.TimeControl3dPlugin',
title: Oskari.getMsg('TimeControl3d', 'publisher.toolLabel'),
config: this.state?.pluginConfig || {}
};
}

/**
* Get values.
* @method getValues
* @public
*
* @returns {Object} tool value object
*/
getValues () {
if (this.state.enabled) {
return {
id: 'Oskari.mapping.time-control-3d.TimeControl3dPlugin',
title: 'TimeControl3d',
config: {}
};
},
/**
* Get values.
* @method getValues
* @public
*
* @returns {Object} tool value object
*/
getValues: function () {
if (this.state.enabled) {
return {
configuration: {
mapfull: {
conf: {
plugins: [{ id: this.getTool().id, config: this.getPlugin().getConfig() }]
}
configuration: {
mapfull: {
conf: {
plugins: [{ id: this.getTool().id, config: this.getPlugin().getConfig() }]
}
}
};
} else {
return null;
}
}
};
} else {
return null;
}
}, {
'extend': ['Oskari.mapframework.publisher.tool.AbstractPluginTool'],
'protocol': ['Oskari.mapframework.publisher.Tool']
});
}
}

// Attach protocol to make this discoverable by Oskari publisher
Oskari.clazz.defineES('Oskari.publisher.TimeControl3dTool',
TimeControl3dTool,
{
protocol: ['Oskari.mapframework.publisher.Tool']
}
);

export { TimeControl3dTool };

0 comments on commit b6d1453

Please sign in to comment.