Skip to content

Commit 682e4d4

Browse files
author
gondzo
committed
fix lat/lon change to currentLocation
1 parent 6386e42 commit 682e4d4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components/maps/GoogleMap.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class GoogleMap extends Component {
3535
getMarkerConfig(drone) {
3636
const google = window.google;
3737
const config = { clickable: false, crossOnDrag: false,
38-
cursor: 'pointer', position: new google.maps.LatLng(drone.lat, drone.lng) };
38+
cursor: 'pointer', position: new google.maps.LatLng(drone.currentLocation[0],drone.currentLocation[1]) };
3939
switch (drone.status) {
4040
case 'in-motion':
4141
config.icon = 'http://maps.google.com/mapfiles/ms/icons/blue-dot.png';
@@ -90,7 +90,7 @@ class GoogleMap extends Component {
9090
});
9191
// get a list of all the drones
9292
droneApi.getAll().then((drones) => {
93-
_self.markers = drones.map((single) => {
93+
_self.markers = drones.items.map((single) => {
9494
const marker = new google.maps.Marker(_self.getMarkerConfig(single));
9595
// set the marker id, to identify a drone uniquely
9696
marker.set('id', single.id);
@@ -110,7 +110,7 @@ class GoogleMap extends Component {
110110
// find a marker by id
111111
const marker = _.find(_self.markers, { id: data.id });
112112
if (marker) {
113-
marker.setPosition(new google.maps.LatLng(data.lat, data.lng));
113+
marker.setPosition(new google.maps.LatLng(data.currentLocation[0], data.currentLocation[1]));
114114
// repaint the cluster
115115
_self.markerCluster.repaint();
116116
}

0 commit comments

Comments
 (0)