google-maps-react icon indicating copy to clipboard operation
google-maps-react copied to clipboard

marker animation

Open EwaMakowska opened this issue 7 years ago • 9 comments

OK, now I want to use marker animation, but I can't find some official example.

I found solution (https://stackoverflow.com/questions/44729776/how-can-animation-be-added-to-markers-in-react-google-maps) where I do it exacly like in vanilia javaScript. Just adding animation={google.maps.Animation.DROP} to marker:

                <Marker 
                    title={}
                    name={}
                    position={}
                    animation={google.maps.Animation.DROP}
                />

but then I have error

google is not defined

And, unfortunately, adding /global google/ at the top of my js won't help.

So please, advice me how to add marker animation using google-maps-react.

EwaMakowska avatar Oct 14 '17 19:10 EwaMakowska

this.props.google.maps.Animation.DROP should work.

vegtelenseg avatar Oct 15 '17 08:10 vegtelenseg

Unfortunately now I have error

Cannot read property 'maps' of undefined

EwaMakowska avatar Oct 15 '17 10:10 EwaMakowska

@EwaMakowska what version are you using?

auser avatar Mar 21 '18 20:03 auser

also having the same issue.

"google-maps-react": "^1.1.4",

google version: "3.30"

tbowdollar avatar Apr 10 '18 21:04 tbowdollar

And what about this error? Because I have the same problem ....

hajczek avatar May 30 '18 08:05 hajczek

Can you make a runnable example? Check the readme for more info on how to do that.

auser avatar May 30 '18 09:05 auser

I'm using the version "2.0.2" and it's working! <Marker title={} name={} position={} animation={this.props.google.maps.Animation.DROP} /> Just like @vegtelenseg said!

WilliamVelazquez avatar Jul 05 '18 18:07 WilliamVelazquez

Can I set trigger time for this because as soon as the Map component is loaded my animation is already complete and can not see the effects of it.

php7webmob avatar Jul 30 '19 07:07 php7webmob

Unfortunately now I have error

Cannot read property 'maps' of undefined

try this animation={2} or animation={1 to 4}

akber777 avatar Nov 21 '20 21:11 akber777