-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2dd1e66
commit b6d1453
Showing
7 changed files
with
64 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 55 additions & 42 deletions
97
bundles/mapping/time-control-3d/tool/TimeControl3dTool.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }; |