@@ -12,6 +12,7 @@ import LocationEditingListUI from './js/ui/locationEditingListUI';
1212import DialogComponent from './js/ui/dialog/dialog' ;
1313import Locations from '../../repository/Locations' ;
1414import { getDisplayName } from './js/util/helpers' ;
15+ import { isCameraControlVersion } from '../../shared/utils/mapUtils' ;
1516
1617const sidenavContainer = document . getElementById ( 'sidenav-container' ) ;
1718const emptyState = document . getElementById ( 'empty-state' ) ;
@@ -377,7 +378,6 @@ const removeAsEditingLocations = (location, index, callback) => {
377378 } , ( e , data ) => {
378379 if ( e ) console . error ( e ) ;
379380 if ( data && data . selectedButton . key === "y" ) {
380-
381381 const payload = {
382382 $set : {
383383 lastUpdatedOn : new Date ( ) ,
@@ -651,7 +651,6 @@ const openLocationPermsDialog = (location) => {
651651 callback ( item ) ;
652652 } ;
653653
654-
655654 const locationTagsListContainer = document . createElement ( 'div' ) ;
656655 const tagsContainerTitle = document . createElement ( 'h5' ) ;
657656
@@ -740,7 +739,6 @@ const initLocationEditing = () => {
740739 const defaultLocationsTimeRadios = document . querySelectorAll ( 'input[name="defaultLocationTime"]' ) ;
741740 let timeoutId ;
742741
743-
744742 for ( const radio of defaultLocationsTimeRadios ) {
745743 if ( radio . value === state . settings . locationEditors . time ) {
746744 radio . checked = true ;
@@ -1015,15 +1013,20 @@ const initMap = () => {
10151013
10161014window . intiGoogleMap = ( ) => {
10171015 const searchBoxElem = document . querySelector ( '#initial-area-location-input' ) ;
1018- const map = new google . maps . Map ( document . getElementById ( "location-map" ) , {
1016+ const options = {
10191017 center : { lat : - 34.397 , lng : 150.644 } ,
10201018 zoom : 10 ,
1021- zoomControl : true ,
10221019 mapTypeControl : false ,
10231020 streetViewControl : false ,
10241021 fullscreenControl : false ,
10251022 gestureHandling : "greedy" ,
1026- } ) ;
1023+ } ;
1024+ if ( isCameraControlVersion ( ) ) {
1025+ options . cameraControl = true ;
1026+ } else {
1027+ options . zoomControl = true ;
1028+ }
1029+ const map = new google . maps . Map ( document . getElementById ( "location-map" ) , options ) ;
10271030 state . map = map ;
10281031
10291032 const autocomplete = new google . maps . places . SearchBox (
@@ -1102,7 +1105,7 @@ window.intiGoogleMap = () => {
11021105 console . log ( "No results found" ) ;
11031106 }
11041107 } else {
1105- console . log ( " Geocoder failed due to: " + status ) ;
1108+ console . log ( ` Geocoder failed due to: ${ status } ` ) ;
11061109 }
11071110 }
11081111 ) ;
@@ -1185,7 +1188,7 @@ const setActiveSidenavTab = (section) => {
11851188 const sidenav = document . querySelector ( '#sidenav' ) ;
11861189 for ( const tab of sidenav . childNodes ) {
11871190 tab . querySelector ( 'a' ) . classList . remove ( 'active' ) ;
1188- } ;
1191+ }
11891192
11901193 sidenav . querySelector ( `#${ section } -tab` ) . firstChild . classList . add ( 'active' ) ;
11911194} ;
0 commit comments