-
Hey guys, I'm trying to add multiple overlayviews to the map but I'm getting return (
<Map {...mapOptions>
{path.map((pos) => (
<OverlayView key={pos.lat + pos.lng} position={pos} mapPaneName={OverlayView.FLOAT_PANE} />
))}
<Polyline
key={idx}
options={{
strokeColor: "#FF4C51",
strokeOpacity: 1,
strokeWeight: 6,
path,
}}
/>
</Map>
); I need multiple overlayviews to draw a route like this (using polylines and overlayviews as connecting points) How can I use multiple overlayviews? Maybe there's another way to draw what I need? |
Beta Was this translation helpful? Give feedback.
Answered by
bn-piar
Sep 1, 2022
Replies: 2 comments 2 replies
-
Wrap return js in fragment
…On Mon, 29 Aug 2022 at 7:12 PM, bn-piar ***@***.***> wrote:
Hey guys, I'm trying to add multiple overlayviews to the map but I'm
getting React.Children.only expected to receive a single React element
child error.
return (
<Map {...mapOptions>
{path.map((pos) => (
<OverlayView key={pos.lat + pos.lng} position={pos} mapPaneName={OverlayView.FLOAT_PANE} />
))}
<Polyline
key={idx}
options={{
strokeColor: "#FF4C51",
strokeOpacity: 1,
strokeWeight: 6,
path,
}}
/>
</Map>);
I need multiple overlayviews to draw a route like this (using polylines
and overlayviews as connecting points)
[image: image]
<https://user-images.githubusercontent.com/105789105/187197637-efc865bf-29e5-4c74-9599-fa33c15fa927.png>
How can I use multiple overlayviews? Maybe there's another way to draw
what I need?
—
Reply to this email directly, view it on GitHub
<#3089>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AARGY6KQCLA5HNXHV3S5YZDV3SSLDANCNFSM575RWGSQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
2 replies
-
Okay so <OverlayView>
<div />
</OverlayView> |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
bn-piar
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Okay so
OverlayView
requires achildren
.