-
Notifications
You must be signed in to change notification settings - Fork 935
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
Applying custom map styles? #53
Comments
@zth do you refer to stuff like this? Custom map style:Marker and InfoWindowhttps://tomchentw.github.io/react-google-maps/#events/event-closure |
Not |
Close this due to inactivity. Thanks @JanKantyPawelski to point that out. |
For me adding styles as a prop didn't work. I had to add the styles to the |
you can find this on here its really useful and easy to use |
If one of you can update your links that would make my night :D |
New example: Please read the documentation site first! |
How can i add custom style on the GoogleMap import {withGoogleMap, GoogleMap, Marker, Polyline} from "react-google-maps"; <GoogleMap is not working |
|
Hey I am not sure if I actually ever got this working, because I know right
now I just have a greyscale filter. But Here is what my component
looks like[image:
Inline image 1]
where styles is [image: Inline image 2]
You can find/ create different mapstyle.json on Google map developer site.
Good luck!
…On Tue, Nov 14, 2017 at 1:54 AM, Win Sandy Myint ***@***.***> wrote:
@anusree-mmlab <https://github.com/anusree-mmlab>
const exampleMapStyles = [] //Add some style
<GoogleMap
defaultOptions={{ styles: exampleMapStyles }}
>
Example here <https://tomchentw.github.io/react-google-maps/#!/InfoBox>
Check fancy map styles here <https://snazzymaps.com/>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#53 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AT-vXIBmM0k1Hc5tzZ9H0jiQw6noiOwNks5s2UdQgaJpZM4EclFw>
.
|
@winsandymyint you did it! love you ❤️ |
It is possible using the following way:
|
I can confirm @anusree-mmlab method worked for me. Just put your JSON style into a JS file as so: Then, in your map component:
|
Little late to the party but nothing I do seems to quite work. I gave up on having ... Style data as JSON (from snazzy maps) and placed within a exported variable named "greyMap" and saved the file as mapStyles.js I then imported it into a component the GoogleMaps component is in With my GoogleMaps component looking like I tried defaultOptions={{ style: greyMap }} and got the same results. Not sure what I'm doing wrong! |
@coderdix The repo of this project is unmaintained more than a year, and we had build new version https://www.npmjs.com/package/@react-google-maps/api We had rewrite it to TypeScript, and updating it frequently: https://github.com/JustFly1984/react-google-maps-api/tree/master/packages/react-google-maps-api You can see our docs: https://react-google-maps-api-docs.netlify.app Also a lot of examples: https://react-google-maps-api-gatsby-demo.netlify.app/ https://github.com/JustFly1984/react-google-maps-api/tree/master/packages/react-google-maps-api-gatsby-example/src/examples The bundle size is much smaller: https://bundlephobia.com/result?p=@react-google-maps/api Our Spectrum community: https://spectrum.chat/react-google-maps Our Slack channel: https://join.slack.com/t/react-google-maps-api/shared_invite/enQtODc5ODU1NTY5MzQ4LTBiNTYzZmY1YmVjYzJhZThkMGU0YzUwZjJkNGJmYjk4YjQyYjZhMDk2YThlZGEzNDc0M2RhNjBmMWE4ZTJiMjQ Enjoy! |
I'm using that one I keep searching when I have an issue and posting on the wrong forum lol |
my map keeps overflowing |
Can you please provide a screenshoot? And also the code you used in the example for us to be able to reproduce it... |
Add position property as relative in mapContainerStyle props it will not overflow |
Hi! I just found this repo and am implementing it in a project I'm working on. Runs very smooth, thanks for this!
However, I want to apply my own map style to the map, and I fail to see how/where I can do that. Any ideas on how/if that can be done?
Also, where do I put other props for the map/markers, like icon for marker, assigning an info window to it and opening it on click etc? I noticed there seems to be a component called InfoWindow, but I couldn't find any documentation about it.
Thanks in advance, and thanks for the great repo!
The text was updated successfully, but these errors were encountered: