Cleaning before switching to SoliJS
This commit is contained in:
1 parent
2fa6199979
commit
8bb8792ee2
28 files changed
-17519
No files matched your search
@@ -1,7 +0,0 @@
|
||||
.getLocation {
|
||||
--opacity: 0.6;
|
||||
--ion-background-color: white;
|
||||
margin-left: calc(50% - 20px);
|
||||
position: fixed;
|
||||
bottom: 6px;
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
import React from 'react';
|
||||
|
||||
import { Geolocation } from '@awesome-cordova-plugins/geolocation';
|
||||
|
||||
import style from './GetLocation.module.css';
|
||||
import { IonButton, IonIcon } from '@ionic/react';
|
||||
import { locateOutline } from 'ionicons/icons';
|
||||
import { useAtom } from 'jotai';
|
||||
import { stateAtom } from '../map';
|
||||
import { locationAtom } from '../show-location';
|
||||
|
||||
// import { locationAtom } from '../map/CurrentLocation';
|
||||
|
||||
const GetLocation: React.FC<{}> = () => {
|
||||
const [state, setState] = useAtom(stateAtom);
|
||||
|
||||
const [, setLocation] = useAtom(locationAtom);
|
||||
|
||||
const onClickHandler = (event: any) => {
|
||||
console.log('Click handler');
|
||||
Geolocation.getCurrentPosition().then((position) => {
|
||||
console.log({ caller: 'GetLocation/onClickHandler', position, state });
|
||||
setState({
|
||||
zoom: state.zoom,
|
||||
rotation: state.rotation,
|
||||
center: [position.coords.longitude, position.coords.latitude],
|
||||
});
|
||||
setLocation([position.coords.longitude, position.coords.latitude]);
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<IonButton
|
||||
className={style.getLocation}
|
||||
shape='round'
|
||||
size='small'
|
||||
fill='solid'
|
||||
onClick={onClickHandler}
|
||||
>
|
||||
<IonIcon slot='icon-only' icon={locateOutline} color='white' />
|
||||
</IonButton>
|
||||
);
|
||||
};
|
||||
|
||||
export default GetLocation;
|
||||
@@ -1 +0,0 @@
|
||||
export { default } from './GetLocation';
|
||||
Reference in new issue
Block a user