function() {
const startImage = {
src: "https://t1.daumcdn.net/localimg/localimages/07/mapapidoc/red_b.png",
size: [50, 45],
options: {
offset: [15, 43],
},
}
const startDragImage = {
src: "https://t1.daumcdn.net/localimg/localimages/07/mapapidoc/red_drag.png",
size: [50, 64],
options: {
offset: [15, 54],
},
}
const endImage = {
src: "https://t1.daumcdn.net/localimg/localimages/07/mapapidoc/blue_b.png",
size: [50, 45],
options: {
offset: [15, 43],
},
}
const endDragImage = {
src: "https://t1.daumcdn.net/localimg/localimages/07/mapapidoc/blue_drag.png",
size: [50, 64],
options: {
offset: [15, 54],
},
}
const [start, setStart] = useState(startImage)
const [end, setEnd] = useState(endImage)
return (
<Map
center={{
lat: 33.450701,
lng: 126.570667,
}}
style={{
width: "100%",
height: "450px",
}}
level={3}
>
<MapMarker
position={{
lat: 33.450701,
lng: 126.570667,
}}
image={start}
draggable={true}
onDragStart={() => setStart(startDragImage)}
onDragEnd={() => setStart(startImage)}
/>
<MapMarker
position={{
lat: 33.450701,
lng: 126.572667,
}}
image={end}
draggable={true}
onDragStart={() => setEnd(endDragImage)}
onDragEnd={() => setEnd(endImage)}
/>
</Map>
)
}