@@ -565,7 +565,7 @@ module.exports = class GPS extends OverlayPlugin {
565
565
// Update map
566
566
if ( this . map ) {
567
567
this . clearMarkers ( ) ;
568
- this . addMapMarker ( position . coords . latitude , position . coords . longitude ) ;
568
+ this . addMapMarker ( position . coords . latitude , position . coords . longitude , true ) ;
569
569
this . map . setCenter ( { lat : position . coords . latitude , lng : position . coords . longitude } ) ;
570
570
}
571
571
} catch ( error ) {
@@ -597,6 +597,8 @@ module.exports = class GPS extends OverlayPlugin {
597
597
lng : info . longitude ,
598
598
} ,
599
599
zoom : this . minimumZoomLevel ,
600
+ streetViewControl : false ,
601
+ mapTypeControl : false ,
600
602
} ) ;
601
603
602
604
// Add initial marker for selection from form
@@ -606,7 +608,7 @@ module.exports = class GPS extends OverlayPlugin {
606
608
this . map . addListener ( 'click' , ( event ) => {
607
609
this . clearMarkers ( ) ;
608
610
// Add new marker / capture coords for click location
609
- this . addMapMarker ( event . latLng . lat ( ) , event . latLng . lng ( ) ) ;
611
+ this . addMapMarker ( event . latLng . lat ( ) , event . latLng . lng ( ) , true ) ;
610
612
} ) ;
611
613
}
612
614
}
@@ -616,8 +618,9 @@ module.exports = class GPS extends OverlayPlugin {
616
618
*
617
619
* @param {number } lat Latitude of the marker.
618
620
* @param {number } lng Longitude of the marker.
621
+ * @param {boolean } setAltitudeAuto Retrieve and set altitude from gmaps.
619
622
*/
620
- addMapMarker ( lat , lng ) {
623
+ addMapMarker ( lat , lng , setAltitudeAuto = false ) {
621
624
if ( typeof google === 'undefined' ) {
622
625
return ;
623
626
}
@@ -646,7 +649,7 @@ module.exports = class GPS extends OverlayPlugin {
646
649
}
647
650
648
651
// Get elevation if service is available
649
- if ( this . elevationService ) {
652
+ if ( this . elevationService && setAltitudeAuto ) {
650
653
const location = new google . maps . LatLng ( numLat , numLng ) ;
651
654
this . elevationService . getElevationForLocations (
652
655
{
0 commit comments