react-static-google-map
react-static-google-map copied to clipboard
Why are markers required?
First, thanks for this package!
I just want to display a map, centered in a location but I am getting "Component must have `Marker`, `Path` or `Direction` child"
error
Google docs says that markers are optional
so, why are they required? can we please make them optional?
This makes sense. The StaticGoogleMap
should probably support this case. We have outlined a couple of things that we would like to add to a V2 and this seems like one of those things. But there is no timeline on V2. Could you try this
const Blank = () => '';
<StaticGoogleMap center={...}>
<Blank />
</StaticGoogleMap>
// or even
<StaticGoogleMap center={...}>
{() => ''}
</StaticGoogleMap>
The StaticGoogleMap
can take a component that is not one exported from this lib. The child components actually do not "render" any HTML but instead return additional query params to add the the URL for the map. By giving it a component that returns an empty string, I believe you will get the result you are looking for.