Arquisoft / radarin_es4b

0 stars 2 forks source link

Problema geolocalizar usuario #31

Closed UO266640 closed 3 years ago

UO266640 commented 3 years ago

https://github.com/Arquisoft/radarin_es4b/blob/master/webapp/src/components/GeoMap.js

Conseguimos obtener las coordenadas de la localización actual

getCurrentLocation() {
    navigator.geolocation.getCurrentPosition(function (position) {
      console.log("Latitude is :", position.coords.latitude);
      console.log("Longitude is :", position.coords.longitude);
      this.setState({
        latGeo: position.coords.latitude,
        lonGeo: position.coords.longitude
      });
    }.bind(this))
  }

Sin embargo, esto no se refleja en el mapa

 render() {
    return (
      <Map
        google={this.props.google}
        zoom={8}
        style={mapStyles}
        initialCenter={{
          lat: this.state.latGeo,
          lng: this.state.lonGeo
        }}>
        {this.showMarkers()}
      </Map>
    );
  }
UO266640 commented 3 years ago

381eac47bdd7c64351b9d6db34764275951b8256 4ba5465930c899b9fc54ae40c58cbb745f134674

uo270628 commented 3 years ago

Geolocalización del user y marcado del mismo arreglado https://github.com/Arquisoft/radarin_es4b/commit/117a90b2fee4c2d2d52afc25e4ffdddb9a007819