File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
src/routes/MissionPlanner/components/MissionMap Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,12 @@ import NoFlyZone from 'components/NoFlyZone';
6
6
import { GOOGLE_MAPS_BOUNDS_TIMEOUT } from 'Const' ;
7
7
import styles from './MissionMap.scss' ;
8
8
9
+ // default center location for mission Planner
9
10
const mapConfig = {
10
11
defaultZoom : 13 ,
11
12
defaultCenter : {
12
- lat : - 6.202180076671433 ,
13
- lng : 106.83877944946289 ,
13
+ lat : 40.01 ,
14
+ lng : - 105.27 ,
14
15
} ,
15
16
options : {
16
17
clickableIcons : false ,
@@ -85,8 +86,10 @@ export class MissionMap extends Component {
85
86
86
87
handleMapLoad ( map ) {
87
88
this . map = map ;
88
- if ( map ) {
89
- // this.fitMapToBounds(map, this.props.markers);
89
+ if ( map ) {
90
+ if ( this . props . markers . length > 0 ) {
91
+ this . fitMapToBounds ( map , this . props . markers ) ;
92
+ } else {
90
93
navigator . geolocation . getCurrentPosition ( ( pos ) => {
91
94
map . panTo ( {
92
95
lat : pos . coords . latitude ,
@@ -98,6 +101,7 @@ export class MissionMap extends Component {
98
101
) ;
99
102
}
100
103
}
104
+ }
101
105
102
106
render ( ) {
103
107
return (
You can’t perform that action at this time.
0 commit comments