Skip to content

Commit 7baf013

Browse files
authored
[UNI-211] feat : 건물과 길을 이어주는 길 생성 (#117)
* [UNI-211] feat : building과 route 이어주는 로직 추가 * [UNI-77] feat : geodesic 제거
1 parent 5b03322 commit 7baf013

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

uniro_frontend/src/component/NavgationMap.tsx

+43
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,54 @@ const NavigationMap = ({ style, routeResult, risks, isDetailView, topPadding = 0
4040

4141
const { routes, routeDetails } = routeResult;
4242

43+
if (!origin || !destination) {
44+
return;
45+
}
46+
47+
const startingBuildingPath = [{ lat: origin?.lat, lng: origin?.lng }, routes[0].node1];
48+
49+
const endingBuildingPath = [routes[routes.length - 1].node2, { lat: destination?.lat, lng: destination?.lng }];
50+
4351
// 하나의 길 완성
4452
const paths = [routes[0].node1, ...routes.map((el) => el.node2)];
4553

4654
const bounds = new google.maps.LatLngBounds();
4755

56+
const dashSymbol = {
57+
path: "M 0,-1 0,1",
58+
strokeOpacity: 1,
59+
scale: 3,
60+
};
61+
62+
// 시작 building과 첫번째 점을 이어주는 polyline
63+
new Polyline({
64+
path: startingBuildingPath,
65+
map,
66+
strokeOpacity: 0,
67+
icons: [
68+
{
69+
icon: dashSymbol,
70+
offset: "0",
71+
repeat: "20px",
72+
},
73+
],
74+
geodesic: true,
75+
});
76+
77+
// 마지막 building과 마지막 점을 이어주는 polyline
78+
new Polyline({
79+
path: endingBuildingPath,
80+
map,
81+
strokeOpacity: 0,
82+
icons: [
83+
{
84+
icon: dashSymbol,
85+
offset: "0",
86+
repeat: "20px",
87+
},
88+
],
89+
});
90+
4891
new Polyline({
4992
path: paths,
5093
map,

0 commit comments

Comments
 (0)