Skip to content

Commit

Permalink
feat(globe): add reset globe position button (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
KatvonRivia authored Mar 5, 2020
1 parent dd41205 commit 031a601
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/scripts/components/globe-navigation/globe-navigation.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import React, {FunctionComponent} from 'react';
import {useDispatch, useSelector} from 'react-redux';

import config from '../../config/main';
import Button from '../button/button';
import {CompassIcon} from '../icons/compass-icon';
import {DownloadIcon} from '../icons/download-icon';
import {GlobeProjection} from '../../types/globe-projection';
import setGlobeProjectionAction from '../../actions/set-globe-projection';
import {projectionSelector} from '../../selectors/globe/projection';
import setFlyToAction from '../../actions/set-fly-to';

import {GlobeProjection} from '../../types/globe-projection';

import styles from './globe-navigation.styl';
import {useDispatch, useSelector} from 'react-redux';

const GlobeNavigation: FunctionComponent = () => {
const dispatch = useDispatch();
const defaultView = config.globe.view;
const projectionState = useSelector(projectionSelector);
const label =
projectionState.projection === GlobeProjection.Sphere ? '2D' : '3D';
Expand All @@ -31,7 +35,7 @@ const GlobeNavigation: FunctionComponent = () => {
<Button
className={styles.compassIcon}
icon={CompassIcon}
onClick={() => console.log('placeholder')}
onClick={() => dispatch(setFlyToAction({...defaultView}))}
/>
<Button
className={styles.downloadIcon}
Expand Down

0 comments on commit 031a601

Please sign in to comment.