Skip to content

Add support for mapId option.#1086

Open
jakeFeldman wants to merge 2 commits intogoogle-map-react:masterfrom
jakeFeldman:add-mapid-support
Open

Add support for mapId option.#1086
jakeFeldman wants to merge 2 commits intogoogle-map-react:masterfrom
jakeFeldman:add-mapid-support

Conversation

@jakeFeldman
Copy link
Copy Markdown

@jakeFeldman jakeFeldman commented Jan 9, 2022

Description

This PR adds support for mapId. By default mapId works by adding to the options prop, but we get a warning in the console. This resolves said warning by removing the styles property from the maps option.

I've updated the type defs in the DefinitelyTyped repo as well (PR here)

A Map's styles property cannot be set when a mapId is present.  When a mapId is present Map styles are controlled via the cloud console. Please see documentation at https://developers.google.com/maps/documentation/javascript/styling#cloud_tooling

closes #1070

@jakeFeldman
Copy link
Copy Markdown
Author

Hello @itsmichaeldiego, I'm reaching out to see if you could take a look at this PR. It's enabling mapId support inside map options. Thanks in advance!

@strarsis
Copy link
Copy Markdown

strarsis commented Nov 22, 2022

@jakeFeldman: Awesome! I really need this as I want to use such a map style by map ID!
Edit: Found out by your answer that a mapId can already be used (with a JavaScript warning): #1070 (comment)

@strarsis
Copy link
Copy Markdown

strarsis commented Nov 22, 2022

@jakeFeldman: Also note that the mapId can only be changed (after it was set) by completely resetting the Google Maps instance (see https://stackoverflow.com/a/62947623/4150808).

@humbroll
Copy link
Copy Markdown

I need this PR as well. I hope it's merged to the main. Is this project not active anymore? It seems like it's been a while since the PR was created.

@jakeFeldman
Copy link
Copy Markdown
Author

Not too sure. Doesn't seem like its maintained anymore.

@kevin1193
Copy link
Copy Markdown

Waiting for this to be merged! Would be a good feature.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide a way to set map id.

7 participants