Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for mapId option. #1086

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jakeFeldman
Copy link

@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
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

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

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

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
Author

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

@kevin1193
Copy link

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

options = omit(options, ['styles']);
}

console.log('options', options);

Choose a reason for hiding this comment

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

should remove this

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.
5 participants