Skip to content
Snippets Groups Projects
Commit e438c389 authored by esikkala's avatar esikkala
Browse files

Update slider duration config

parent 67585440
No related branches found
No related tags found
No related merge requests found
...@@ -212,6 +212,7 @@ class TemporalMap extends Component { ...@@ -212,6 +212,7 @@ class TemporalMap extends Component {
dates={dates} dates={dates}
animateMap={animateMap} animateMap={animateMap}
initialValue={this.props.animationValue[0]} initialValue={this.props.animationValue[0]}
sliderDuration={this.props.sliderDuration}
/> />
{this._renderTooltip()} {this._renderTooltip()}
</ReactMapGL> </ReactMapGL>
......
...@@ -2,11 +2,8 @@ import React from 'react' ...@@ -2,11 +2,8 @@ import React from 'react'
import { withStyles } from '@material-ui/core/styles' import { withStyles } from '@material-ui/core/styles'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import Slider from '@material-ui/core/Slider' import Slider from '@material-ui/core/Slider'
import { SLIDER_DURATION } from '../../configs/sampo/GeneralConfig'
import { BaseControl } from 'react-map-gl' import { BaseControl } from 'react-map-gl'
import moment from 'moment' import moment from 'moment'
// import iconImg from './icon.png';
// import BarChart from './TemporalMapBarChart';
const blue = 'rgb(0, 126, 230)' const blue = 'rgb(0, 126, 230)'
const iOSBoxShadow = const iOSBoxShadow =
...@@ -56,7 +53,7 @@ class TemporalMapTimeSlider extends BaseControl { ...@@ -56,7 +53,7 @@ class TemporalMapTimeSlider extends BaseControl {
currentDay: null, currentDay: null,
hideContainer: '', hideContainer: '',
value: 0, value: 0,
sliderDuration: SLIDER_DURATION.normalSpeed, sliderDuration: this.props.sliderDuration.normalSpeed,
intervalSetter: null, intervalSetter: null,
isPlaying: false, isPlaying: false,
playOrPause: 'play', playOrPause: 'play',
...@@ -143,7 +140,7 @@ class TemporalMapTimeSlider extends BaseControl { ...@@ -143,7 +140,7 @@ class TemporalMapTimeSlider extends BaseControl {
if (type === 'half') { if (type === 'half') {
this.setState( this.setState(
{ {
sliderDuration: SLIDER_DURATION.halfSpeed, sliderDuration: this.props.sliderDuration.halfSpeed,
halfSpeedEnabled: true, halfSpeedEnabled: true,
regularSpeedEnabled: false, regularSpeedEnabled: false,
doubleSpeedEnabled: false doubleSpeedEnabled: false
...@@ -156,7 +153,7 @@ class TemporalMapTimeSlider extends BaseControl { ...@@ -156,7 +153,7 @@ class TemporalMapTimeSlider extends BaseControl {
} else if (type === 'regular') { } else if (type === 'regular') {
this.setState( this.setState(
{ {
sliderDuration: SLIDER_DURATION.normalSpeed, sliderDuration: this.props.sliderDuration.normalSpeed,
halfSpeedEnabled: false, halfSpeedEnabled: false,
regularSpeedEnabled: true, regularSpeedEnabled: true,
doubleSpeedEnabled: false doubleSpeedEnabled: false
...@@ -169,7 +166,7 @@ class TemporalMapTimeSlider extends BaseControl { ...@@ -169,7 +166,7 @@ class TemporalMapTimeSlider extends BaseControl {
} else if (type === 'double') { } else if (type === 'double') {
this.setState( this.setState(
{ {
sliderDuration: SLIDER_DURATION.doubleSpeed, sliderDuration: this.props.sliderDuration.doubleSpeed,
halfSpeedEnabled: false, halfSpeedEnabled: false,
regularSpeedEnabled: false, regularSpeedEnabled: false,
doubleSpeedEnabled: true doubleSpeedEnabled: true
......
...@@ -59,6 +59,7 @@ const { ...@@ -59,6 +59,7 @@ const {
layoutConfig, layoutConfig,
MAPBOX_ACCESS_TOKEN, MAPBOX_ACCESS_TOKEN,
MAPBOX_STYLE, MAPBOX_STYLE,
SLIDER_DURATION,
yasguiBaseUrl, yasguiBaseUrl,
yasguiParams yasguiParams
} = await import(`../configs/${portalID}/GeneralConfig`) } = await import(`../configs/${portalID}/GeneralConfig`)
...@@ -420,6 +421,7 @@ const SemanticPortal = props => { ...@@ -420,6 +421,7 @@ const SemanticPortal = props => {
networkConfig={networkConfig} networkConfig={networkConfig}
yasguiBaseUrl={yasguiBaseUrl} yasguiBaseUrl={yasguiBaseUrl}
yasguiParams={yasguiParams} yasguiParams={yasguiParams}
sliderDuration={SLIDER_DURATION}
/> />
</Grid> </Grid>
</Grid> </Grid>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment