summaryrefslogtreecommitdiff
path: root/src/Geshem.js
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2019-10-17 11:49:22 +0300
committerYuval Adam <_@yuv.al>2019-10-17 11:49:22 +0300
commit07afb387a9e00588ded8b76ae153aa74f30cdb05 (patch)
treec51de65d975368c7bfd2d7950c9fd7546bb43f4f /src/Geshem.js
parent190a16ee4a38e2a68c75daebd43126fd2f62a936 (diff)
Remove unused OldGeshem
Diffstat (limited to 'src/Geshem.js')
-rw-r--r--src/Geshem.js32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/Geshem.js b/src/Geshem.js
index 4007c10..4e8c9fd 100644
--- a/src/Geshem.js
+++ b/src/Geshem.js
@@ -1,4 +1,4 @@
-import React, { useState, useEffect, Component } from "react";
+import React, { useState, useEffect } from "react";
import { BrowserRouter as Router, Route } from "react-router-dom";
import Map from "./Map";
@@ -62,24 +62,22 @@ function Geshem(props) {
);
}
-class OldGeshem extends Component {
- getGeolocation() {
- if (navigator.geolocation) {
- navigator.geolocation.getCurrentPosition(pos => {
- const { longitude, latitude } = pos.coords;
- this.setState({
- lng: longitude,
- lat: latitude,
+function getGeolocation() {
+ if (navigator.geolocation) {
+ navigator.geolocation.getCurrentPosition(pos => {
+ const { longitude, latitude } = pos.coords;
+ this.setState({
+ lng: longitude,
+ lat: latitude,
+ zoom: 11
+ });
+ if (this.state.mapLoaded) {
+ this.map.jumpTo({
+ center: [longitude, latitude],
zoom: 11
});
- if (this.state.mapLoaded) {
- this.map.jumpTo({
- center: [longitude, latitude],
- zoom: 11
- });
- }
- });
- }
+ }
+ });
}
}