Skip to content

feat(google-maps): Separate mapId for Google Maps Cloud IDs - #1750

Merged
theproducer merged 11 commits into
mainfrom
google-maps/map-id
Oct 23, 2023
Merged

feat(google-maps): Separate mapId for Google Maps Cloud IDs#1750
theproducer merged 11 commits into
mainfrom
google-maps/map-id

Conversation

@theproducer

@theproducer theproducer commented Aug 22, 2023

Copy link
Copy Markdown
Contributor

This PR adds support for a separate optional mapId that is used for cloud based map styling and features:
https://developers.google.com/maps/documentation/get-map-id

closes: #1708
closes ionic-team/capacitor#7011

@theproducer
theproducer marked this pull request as ready for review August 22, 2023 17:55

@jcesarmobile jcesarmobile left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good, but should we use different config options for Android and iOS?
the mapId is unique per platform, so having a single mapId option will mean users will have to detect the platform and pass the id for the specific platform, a single mapId can't be used, it will error if you try to use a javascript map id in Android (on iOS it surprisingly works, but it shouldn't according to the docs)

@giralte-ionic

Copy link
Copy Markdown
Contributor

I agree with Julio that the platform should be part of the params passed here to avoid the problem. I also don't believe we should assume that iOS will always accept a javascript platform id.

Comment on lines +97 to +98
MapsInitializer.Renderer.LATEST -> Log.d("Capacitor Google Maps", "Latest Google Maps renderer enabled")
MapsInitializer.Renderer.LEGACY -> Log.d("Capacitor Google Maps", "Legacy Google Maps renderer enabled - Cloud based map styling and advanced drawing not available")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Logger.debug instead of android Log class so it can be globally disabled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

feat: googleMap mapId feat: Make 'id' optional when creating a Google Map - Native Static and Dynamic Maps (without id) are charged 0.00 USD

6 participants