refactor(b08): 거리이정표 거래처 탭 = 그림만 — 새 창 길찾기 · 탭 지도 칸 없앰 (250-5)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LLCk2y5xE8YGVgjbTntWsY
This commit is contained in:
@@ -38,7 +38,8 @@ const routePaths = () => [[[35.68, 127.9], [35.64, 127.83]]];
|
||||
FAKE_KAKAO = """
|
||||
class Fake { setMap() {} relayout() {} setBounds() {} extend() {} }
|
||||
(globalThis as any).kakao = { maps: { load: (f: () => void) => f(), LatLng: Fake,
|
||||
LatLngBounds: Fake, Map: Fake, Polyline: Fake, Marker: Fake, CustomOverlay: Fake } };
|
||||
LatLngBounds: Fake, Map: Fake, Polyline: Fake, Marker: Fake, CustomOverlay: Fake,
|
||||
event: { addListener: () => {} } } };
|
||||
"""
|
||||
|
||||
|
||||
@@ -48,7 +49,9 @@ def _view(setup):
|
||||
+ setup
|
||||
+ IMPORTS.sub("", _read(KMAP))
|
||||
+ """
|
||||
const view = routeMapView("p1", "r1");
|
||||
// 156 경로 탭 지도 칸 없앰 — 같은 SDK 싣기 · 안내 길 = 연결선 모달 지도 칸(editMap)
|
||||
const view = editMap("p1", { onMove: () => {}, hint: "길 선 = 카카오 길찾기 · 경로 그림은 서버가 자동으로 만듦" });
|
||||
view.set([{ key: "r1", name: "거창군청", lon: 127.9, lat: 35.68, movable: true }], routePaths());
|
||||
await new Promise((r) => setTimeout(r, 30));
|
||||
const [hint, box] = view.root.children;
|
||||
console.log(JSON.stringify({ injected, hint: hint.textContent, boxHidden: box.hidden,
|
||||
|
||||
@@ -76,16 +76,10 @@ def test_방위_좌표_자동():
|
||||
|
||||
|
||||
def test_다음_지도_길찾기_주소():
|
||||
pts = [{"name": "거창군청", "lon": 127.909, "lat": 35.686},
|
||||
{"name": "병곡리, 968/31", "lon": 127.75, "lat": 35.78},
|
||||
{"name": "임도 시점", "lon": 127.74, "lat": 35.79}] # fmt: skip
|
||||
url = _node(f"kakaoRouteUrl({json.dumps(pts, ensure_ascii=False)})")
|
||||
# 공식 꼴 /link/by/car/이름,위도,경도/… · 이름의 쉼표 · 빗금은 빈칸
|
||||
assert url == (
|
||||
"https://map.kakao.com/link/by/car/%EA%B1%B0%EC%B0%BD%EA%B5%B0%EC%B2%AD,35.686,127.909/"
|
||||
"%EB%B3%91%EA%B3%A1%EB%A6%AC%20%20968%2031,35.78,127.75/"
|
||||
"%EC%9E%84%EB%8F%84%20%EC%8B%9C%EC%A0%90,35.79,127.74"
|
||||
)
|
||||
# 156 경로 탭 새 창 길찾기 없앰(길찾기 = 연결선 모달 · 카카오 길찾기 API) — 주소 만들기도 없음
|
||||
assert "kakaoRouteUrl" not in _read("B08_Quantity/B08_Quantity_Milestone_Layout.ts")
|
||||
route = _read("B08_Quantity/B08_Quantity_UI_Milestone_Route.ts")
|
||||
assert "window.open(" not in route and "다음 지도에서 길찾기" not in route
|
||||
|
||||
|
||||
def test_VWorld_좌표_주소(monkeypatch):
|
||||
@@ -174,7 +168,6 @@ def test_화면_모달_팬줌_그림탭():
|
||||
assert (
|
||||
"createDataTable" not in route and "구간" not in route.split("export function routeView")[1]
|
||||
)
|
||||
assert "window.open(kakaoRouteUrl(points)" in route
|
||||
assert "getDisplayMedia" not in route and "uploadImage(projectId, routeId, picked)" in route
|
||||
assert 'label: "그림 올리기"' in route
|
||||
page = _read("B08_Quantity/B08_Quantity_UI_Milestone.ts")
|
||||
|
||||
@@ -159,7 +159,11 @@ const PATHS = {json.dumps(paths)};
|
||||
const asked: string[] = [];
|
||||
const request = async (url: string) => (asked.push(url), {{ key: KEY }});
|
||||
{extra}
|
||||
const view = routeMapView("p1", "r1");
|
||||
// 156 경로 탭 지도 칸 없앰 — 같은 SDK 싣기 · 안내 길 = 연결선 모달 지도 칸(editMap)
|
||||
const view = editMap("p1", {{ onMove: () => {{}}, hint: "길 선 = 카카오 길찾기 · 경로 그림은 서버가 자동으로 만듦" }});
|
||||
view.set([{{ key: "r1", name: "거창군청", lon: 127.9, lat: 35.68, movable: true }},
|
||||
{{ key: "base", name: "병곡리", lon: 127.85, lat: 35.66, movable: true }},
|
||||
{{ key: "start", name: "시점", lon: 127.83, lat: 35.64, movable: false }}], PATHS);
|
||||
await new Promise((r) => setTimeout(r, 30));
|
||||
const [hint, box] = view.root.children;
|
||||
console.log(JSON.stringify({{ asked, injected, hint: hint.textContent, boxHidden: box.hidden,
|
||||
@@ -193,6 +197,7 @@ const on = (kind: string, o: any) => ({ setMap: (m: any) => m && LOG.overlays.pu
|
||||
Polyline: function (o: any) { return on("line", o); },
|
||||
Marker: function (o: any) { return on("marker", o); },
|
||||
CustomOverlay: function (o: any) { return on("label", o); },
|
||||
event: { addListener: () => {} },
|
||||
} };
|
||||
"""
|
||||
|
||||
@@ -218,8 +223,9 @@ def test_화면_자리_캡처_키_서버만():
|
||||
leg = _read("B08_Quantity/B08_Quantity_UI_Milestone_LegModal.ts") # 244-13 = 연결선 모달 지도
|
||||
assert "mapHead, map.root" in leg and "map.set(pins()" in leg
|
||||
route = _read("B08_Quantity/B08_Quantity_UI_Milestone_Route.ts")
|
||||
assert "routeMapView(projectId, routeId)" in route
|
||||
assert "mapView.draw();" in route
|
||||
# 156 경로 탭 = 그림만(새 창 길찾기 · 지도 칸 없앰 · 길찾기 · 지도 = 연결선 모달)
|
||||
assert "routeMapView" not in route and "다음 지도에서 길찾기" not in route
|
||||
assert "routeMapView" not in kmap
|
||||
state = _read("B08_Quantity/B08_Quantity_UI_Milestone_State.ts")
|
||||
assert "paths.set(from, res.path!);" in state # 메모리만(캐시 · 서버 안 감)
|
||||
for rel in Path(ROOT / "B08_Quantity").glob("*.ts"): # 키 이름은 서버만
|
||||
|
||||
Reference in New Issue
Block a user