Bernadette Elena Hammerle 4 лет назад
Родитель
Сommit
ba1bc212db
1 измененных файлов с 7 добавлено и 0 удалено
  1. 7 0
      src/maps/Pigeon.js

+ 7 - 0
src/maps/Pigeon.js

@@ -5,6 +5,7 @@ import Overlay from "pigeon-overlay";
 import Draggable from "pigeon-draggable";
 import {longitude, latitude, mapWidth, mapHeight} from "./../config/variables";
 import {Button} from "reactstrap";
+import PathButtons from "./../PathButtons";
 
 export default class Pigeon extends React.Component{
   providers = {
@@ -18,6 +19,11 @@ export default class Pigeon extends React.Component{
     }
   }
 
+  updateState = (key, value) => {
+    this.props.updateMapState(key, value)
+    this.props.getDistance()
+  }
+
   zoomIn = () => {
     let newZoom = Math.min(this.props.mapConfig.zoom + 1, 22)
     this.props.updateMapState("zoom", newZoom)
@@ -93,6 +99,7 @@ export default class Pigeon extends React.Component{
           <p>
             Distanz: {Math.round(mapConfig.distance*100)/100} km
           </p>
+          <PathButtons updateState={this.updateState} path={this.props.mapConfig.path}/>
         </div>
       </div>
     );