@@ -35,7 +35,7 @@ class GoogleMap extends Component {
35
35
getMarkerConfig ( drone ) {
36
36
const google = window . google ;
37
37
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 ] ) } ;
39
39
switch ( drone . status ) {
40
40
case 'in-motion' :
41
41
config . icon = 'http://maps.google.com/mapfiles/ms/icons/blue-dot.png' ;
@@ -90,7 +90,7 @@ class GoogleMap extends Component {
90
90
} ) ;
91
91
// get a list of all the drones
92
92
droneApi . getAll ( ) . then ( ( drones ) => {
93
- _self . markers = drones . map ( ( single ) => {
93
+ _self . markers = drones . items . map ( ( single ) => {
94
94
const marker = new google . maps . Marker ( _self . getMarkerConfig ( single ) ) ;
95
95
// set the marker id, to identify a drone uniquely
96
96
marker . set ( 'id' , single . id ) ;
@@ -110,7 +110,7 @@ class GoogleMap extends Component {
110
110
// find a marker by id
111
111
const marker = _ . find ( _self . markers , { id : data . id } ) ;
112
112
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 ] ) ) ;
114
114
// repaint the cluster
115
115
_self . markerCluster . repaint ( ) ;
116
116
}
0 commit comments