сохранить NewCoordinate полилинии геолокации в Mysql - PullRequest
0 голосов
/ 20 января 2020

У меня есть код для создания координат:

this.watchID = navigator.geolocation.watchPosition(
    position => {
      const { coordinate, routeCoordinates, distanceTravelled } =   this.state;
      const { latitude, longitude } = position.coords;

      const newCoordinate = {
        latitude,
        longitude
      };

и полилинии в каждом обновлении координат:

 this.setState({
     latitude,
     longitude,
     routeCoordinates: routeCoordinates.concat([newCoordinate]),
     distanceTravelled:
     distanceTravelled + this.calcDistance(newCoordinate),
     prevLatLng: newCoordinate
   });

как сохранить координаты полилинии в mysql со временем и имя включить в таблицу?

...