Skip to content

Commit cbd6177

Browse files
authored
Merge pull request #45 from topcoderinc/44_MP_center_issue
44 mp center issue
2 parents 681f01f + ec9dec1 commit cbd6177

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
GOOGLE_API_KEY=AIzaSyCrL-O319wNJK8kk8J_JAYsWgu6yo5YsDI
2-
REACT_APP_API_BASE_PATH=http://localhost:3500
2+
REACT_APP_API_BASE_PATH=https://kb-dsp-server-dev.herokuapp.com
33
REACT_APP_AUTH0_CLIENT_ID=3CGKzjS2nVSqHxHHE64RhvvKY6e0TYpK
44
REACT_APP_AUTH0_CLIENT_DOMAIN=dronetest.auth0.com
5-
REACT_APP_SOCKET_URL=http://localhost:3500
5+
REACT_APP_SOCKET_URL=https://kb-dsp-server-dev.herokuapp.com

src/routes/MissionPlanner/components/MissionMap/MissionMap.jsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ import NoFlyZone from 'components/NoFlyZone';
66
import {GOOGLE_MAPS_BOUNDS_TIMEOUT} from 'Const';
77
import styles from './MissionMap.scss';
88

9+
// default center location for mission Planner
910
const mapConfig = {
1011
defaultZoom: 13,
1112
defaultCenter: {
12-
lat: -6.202180076671433,
13-
lng: 106.83877944946289,
13+
lat: 40.01,
14+
lng: -105.27,
1415
},
1516
options: {
1617
clickableIcons: false,
@@ -85,8 +86,10 @@ export class MissionMap extends Component {
8586

8687
handleMapLoad(map) {
8788
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 {
9093
navigator.geolocation.getCurrentPosition((pos) => {
9194
map.panTo({
9295
lat: pos.coords.latitude,
@@ -98,6 +101,7 @@ export class MissionMap extends Component {
98101
);
99102
}
100103
}
104+
}
101105

102106
render() {
103107
return (

0 commit comments

Comments
 (0)