From 07afb387a9e00588ded8b76ae153aa74f30cdb05 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Thu, 17 Oct 2019 11:49:22 +0300 Subject: Remove unused OldGeshem --- src/Geshem.js | 32 +++++++++++++++----------------- 1 file 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 - }); - } - }); - } + } + }); } } -- cgit v1.3.1