question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

fr(google-maps): add forRoot() for global initializing

See original GitHub issue

Feature Description

like many modules already use it, it would be nice if you could initialize the Google Map with the method forRoot() in app.module.ts with given parameters.

Use Case

initialize with parameters like:

  • apiKey (link apiKey from environment.ts)
  • language
  • region
  • styles (set global styles for map and marker)

These are the first ones I thought of. I’m sure there are many more.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:4
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
mbehrlichcommented, Jul 10, 2020

It’s been brought up often, and we’ve discussed this periodically. One of the reasons we’ve never done this is that we want the user to be aware of the scripts that are being introduced on their page, and we’re worried about obfuscating that from the user. Regarding global options like styling, I will look into this further.

4reactions
devversioncommented, May 28, 2020

Thanks for clarifying. So I think there are two parts you’re requesting:

  1. Global options for the API loading mechanism. That would also involve us automatically loading the google-maps API (currently that’s up to the user)
  2. Global options for actual google-map parts (such as google.maps.MapTypeStyle).

Both of those things sound like reasonable feature requests to me. I’m slightly unsure about (1) as it seems like the intention was that the API-loading responsibility is left to the consumers. Not sure about that though.

I assume @mbehrlich, if available, might be best to answer this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrading Your Maps JavaScript API Application from V2 to V3
Always reference the google.maps namespace. In v3, all Maps JavaScript API code is stored in the google.maps.* namespace instead of the global namespace....
Read more >
How To Integrate Google Maps in Angular with ... - DigitalOcean
Learn how to add a Google Maps component to your Angular application ... Initializing the <agm-map> component with a latitude and longitude ...
Read more >
Change angular-google-maps language dynamically
To do this, I've created a class called AppInitService. Here, I'll initialise various properties in my app on the fly, such as translation ......
Read more >
https://opensource.apple.com/source/WebCore/WebCor...
(WebCore::HTMLMediaElement::playInternal): Treat an interruption as success and return true so that HTMLMediaElement::play() adds the Promise to the end of ...
Read more >
Google Maps
Find local businesses, view maps and get driving directions in Google Maps.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found