Setting map heading

Author: batearedcollieCreated Aug 3, 2022Updated Oct 18, 2024

I am trying to plot where the user can rotate/ adjust the heading. As a start I have tried adding a heading value under options, but when the map plots it appears to plot as rotated then quickly changes back to 0. Is this correct behavior? What am I doing wrong?

Any help gratefully received. I am using the component as follows.

<GoogleMapReact
  bootstrapURLKeys={{ 
    key: GoogleMapsAPIKey,
  }}
  defaultCenter={{lat: this.state.defaultCenter.latitude, lng: this.state.defaultCenter.longitude}}
  defaultZoom={12}	
  options={map => ({ 
    streetViewControl: true,
    scaleControl: true,
    zoomControl: true,
    fullscreenControl: true,
    fullscreenControlOptions: {
       position: google.maps.ControlPosition.TOP_RIGHT,
    },
    controlSize: 25,
   
    mapTypeId: map.MapTypeId.SATELLITE, 
    mapTypeControl: true,
    mapTypeControlOptions: {
    style: map.MapTypeControlStyle.SMALL,
    position: map.ControlPosition.TOP_LEFT,
    mapTypeIds: [
       map.MapTypeId.ROADMAP,
       map.MapTypeId.SATELLITE,
       map.MapTypeId.HYBRID,
       map.MapTypeId.TERRAIN,
    ]
    },
								        
    //Trying to set heading here 
    heading: 90.
    })
  }
  yesIWantToUseGoogleMapApiInternals
  onGoogleApiLoaded={this.handleGoodleAPILoaded}		
>
</GoogleMapReact>

Source: google-map-react/google-map-react