Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GOOGLE_API_KEY=AIzaSyCrL-O319wNJK8kk8J_JAYsWgu6yo5YsDI
REACT_APP_API_BASE_PATH=http://localhost:3500
REACT_APP_API_BASE_PATH=https://kb-dsp-server-dev.herokuapp.com
REACT_APP_AUTH0_CLIENT_ID=3CGKzjS2nVSqHxHHE64RhvvKY6e0TYpK
REACT_APP_AUTH0_CLIENT_DOMAIN=dronetest.auth0.com
REACT_APP_SOCKET_URL=http://localhost:3500
REACT_APP_SOCKET_URL=https://kb-dsp-server-dev.herokuapp.com
12 changes: 8 additions & 4 deletions src/routes/MissionPlanner/components/MissionMap/MissionMap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import NoFlyZone from 'components/NoFlyZone';
import {GOOGLE_MAPS_BOUNDS_TIMEOUT} from 'Const';
import styles from './MissionMap.scss';

// default center location for mission Planner
const mapConfig = {
defaultZoom: 13,
defaultCenter: {
lat: -6.202180076671433,
lng: 106.83877944946289,
lat: 40.01,
lng: -105.27,
},
options: {
clickableIcons: false,
Expand Down Expand Up @@ -85,8 +86,10 @@ export class MissionMap extends Component {

handleMapLoad(map) {
this.map = map;
if (map) {
// this.fitMapToBounds(map, this.props.markers);
if (map ) {
if ( this.props.markers.length > 0 ) {
this.fitMapToBounds(map, this.props.markers);
} else {
navigator.geolocation.getCurrentPosition((pos) => {
map.panTo({
lat: pos.coords.latitude,
Expand All @@ -98,6 +101,7 @@ export class MissionMap extends Component {
);
}
}
}

render() {
return (
Expand Down