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

How can I change the language map in run

Open amirbr opened this issue 8 years ago • 2 comments

Hello,

I need to change googleMaps language on the run, to do this I need to re-fetch google maps script with the right locale. But when the HOC withScriptjs receive a new value for googleMapURL prop, the new URL is not fetched. Actually, withScriptjs file does not implement this behavior.

Did I miss something? Maybe @tomchentw you know why?

Can I contribute to solving this?

Thanks

amirbr avatar Aug 20 '18 13:08 amirbr

You could probably implement this behavior pretty easily. I would imagine something like:

  1. Add the componentDidUpdate method
  2. Check if googleMapUrl has changed

If so, set loadingState to LOADING_STATE_BEGIN and then run the following lines from componentDidMount:

 const scriptjs = require(`scriptjs`)
 const { googleMapURL } = this.props
 scriptjs(googleMapURL, this.handleLoaded)

(Should probably be extracted to a function)

urikphytech avatar Aug 20 '18 18:08 urikphytech

Is there any update? I need this feature for my app.

JustFly1984 avatar Oct 19 '18 03:10 JustFly1984