function(){
const [toggle, setToggle] = useState("map")
const placePosition = {
lat: 33.450701,
lng: 126.570667,
}
return (
<div style={{ width: "100%", height: "300px", position: "relative" }}>
<Map
center={placePosition}
style={{
display: toggle === "map" ? "block" : "none",
width: "100%",
height: "100%",
}}
level={3}
>
<MapMarker position={placePosition} />
{toggle === "map" && (
<input
style={{
position: "absolute",
top: "5px",
left: "5px",
zIndex: 10,
}}
type="button"
onClick={() => setToggle("roadview")}
title="로드뷰 보기"
value="로드뷰"
/>
)}
</Map>
<Roadview
position={{ ...placePosition, radius: 50 }}
style={{
display: toggle === "roadview" ? "block" : "none",
width: "100%",
height: "100%",
}}
>
<RoadviewMarker position={placePosition} />
{toggle === "roadview" && (
<input
style={{
position: "absolute",
top: "5px",
left: "5px",
zIndex: 10,
}}
type="button"
onClick={() => setToggle("map")}
title="지도 보기"
value="지도"
/>
)}
</Roadview>
</div>
)
}