Reformating
This commit is contained in:
parent
8ec7e7d045
commit
3dfbd648b7
|
@ -1,7 +1,7 @@
|
|||
import react from "react";
|
||||
import { useState, useEffect } from "react";
|
||||
import { Map, Marker, ZoomControl } from "pigeon-maps"
|
||||
import { Geolocation } from "@awesome-cordova-plugins/geolocation";
|
||||
import react from 'react';
|
||||
import { useState, useEffect } from 'react';
|
||||
import { Map, Marker, ZoomControl } from 'pigeon-maps';
|
||||
import { Geolocation } from '@awesome-cordova-plugins/geolocation';
|
||||
|
||||
const LiveMap: react.FC = () => {
|
||||
const initialCenter: [number, number] = [44.73574, 6.18981];
|
||||
|
@ -11,22 +11,22 @@ const LiveMap: react.FC = () => {
|
|||
const [zoom, setZoom] = useState(initialZoom);
|
||||
|
||||
useEffect(() => {
|
||||
Geolocation.getCurrentPosition().then((position) =>
|
||||
{
|
||||
Geolocation.getCurrentPosition().then((position) => {
|
||||
setCenter([position.coords.latitude, position.coords.longitude]);
|
||||
setPosition([position.coords.latitude, position.coords.longitude]);
|
||||
}
|
||||
);
|
||||
|
||||
}, [])
|
||||
});
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Map center={center} zoom={zoom} onBoundsChanged={
|
||||
({center, zoom}) => {
|
||||
<Map
|
||||
center={center}
|
||||
zoom={zoom}
|
||||
onBoundsChanged={({ center, zoom }) => {
|
||||
setCenter(center);
|
||||
setZoom(zoom);
|
||||
}
|
||||
} animate={true}>
|
||||
}}
|
||||
animate={true}
|
||||
>
|
||||
<ZoomControl />
|
||||
<Marker width={20} anchor={position} />
|
||||
</Map>
|
||||
|
|
Loading…
Reference in New Issue