tomchentw / react-google-maps

React.js Google Maps integration component
https://tomchentw.github.io/react-google-maps/
MIT License
4.62k stars 939 forks source link

Cannot rotate ground overlay in React Google Maps - property “bearing ” is ignored #1054

Open carlosedof opened 3 years ago

carlosedof commented 3 years ago

I need to place a image with fixed bounds but it has a rotation, because its like a blueprint of a building. To achieve this, I am using GroundOverlay. My problem is, when I set a property option with bearing property, this property is ignored. It does not rotate.

This is where I found bearing property. https://developers.google.com/android/reference/com/google/android/gms/maps/model/GroundOverlayOptions#bearing(float)

Here is my code:

<LoadScript googleMapsApiKey="API-KEY">
        <GoogleMap mapContainerStyle={containerStyle} center={center} zoom={18}>
            <GroundOverlay
              key={"url"}
              url={planta}
              options={{ bearing: 30 }}
              bounds={{
                north,
                south,
                east,
                west,
              }}
            />
        </GoogleMap>
</LoadScript>

If anyone know how can I rotate that image, will be appreciated. I need a solution that could be dynamic and not for that specific image, cause the idea is to render it from backend with the property bearing.

Thank you!!