GithubHelp home page GithubHelp logo

Comments (9)

Qrysto avatar Qrysto commented on September 26, 2024

+1. I've been using react-async-script for loading googlemaps API and it worked fine before I updated to react-google-maps v2. I'm against adding a script tag to load googlemaps API, it's against reactjs's modular structure, so I think react-google-maps itself should provide a way to load googlemaps API or at least play well with 3rd party async script loaders.

from react-google-maps.

tomchentw avatar tomchentw commented on September 26, 2024

Thanks for the info of react-async-script. I believe it's suitable for our usage. I will look at it soon.

from react-google-maps.

Bazze avatar Bazze commented on September 26, 2024

Hey! Any progress on this?

from react-google-maps.

Qrysto avatar Qrysto commented on September 26, 2024

How is this progressing?

from react-google-maps.

tomchentw avatar tomchentw commented on September 26, 2024

Okay. Right now I could add another async.html.js endpoint to examples/gh-pages to demonstrate async loaded scripts. Here's the current result:

Branch

http://git.io/v4nVz

Screenshot

screen shot 2015-10-12 at 10 36 56 am

The error in the web console shows that async loaded google.maps script will fail due to document.write API.

Reason for that

We use react-async-script to load the Google Map API v3. However, inside the code, the script.async flag is set to 1 and cannot change by props. (REF: http://git.io/vCWHB).


11/16/2015 Update

Releases scriptjs version and pending this branch. Update branch URL.

from react-google-maps.

tomchentw avatar tomchentw commented on September 26, 2024

Guys, I've added a new component called < ScriptjsGoogleMap /> using scriptjs to load google maps API v3. The example can be seen on gh-pages:
https://tomchentw.github.io/react-google-maps/async/

Please check it out and let me know any issues, thanks! You can use the version of 4.3.1

from react-google-maps.

tstavinoha avatar tstavinoha commented on September 26, 2024

Using the async script loading internally does not expose important constants like MapTypeId.TERRAIN to map parent component. It makes it unconvenient to set up the map.

Could the default options be set via callback that recieves the maps api reference after loading?

from react-google-maps.

tomchentw avatar tomchentw commented on September 26, 2024

@tstavinoha consider using the callback query parameter in the query props? This is the standard way by Google Maps JavaScript API v3 to handle the "loaded" event. Notice that it has to be a global variable.

from react-google-maps.

tomchentw avatar tomchentw commented on September 26, 2024

Close for now.

We're also looking for maintainers. Involve in #266 to help strengthen our community!

from react-google-maps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.