- favoriteApi: 관심선박/관심구역 API 연동 - favoriteStore: favoriteSet(O(1) lookup), realmList 상태 관리 - ShipBatchRenderer: 관심선박 필터 우선 통과 + 밀도 제한 최우선 - shipLayer: 관심선박 위치에 ico_favship.svg 강조 IconLayer 오버레이 - useRealmLayer: 관심구역 OpenLayers 폴리곤(이름/색상/윤곽선) 렌더링 - useShipLayer: favoriteStore 변경 시 즉시 리렌더 구독 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
28 lines
875 B
JavaScript
28 lines
875 B
JavaScript
import { fetchWithAuth } from './fetchWithAuth';
|
|
|
|
/**
|
|
* 관심선박 목록 조회
|
|
* @returns {Promise<Array>} 관심선박 목록
|
|
*/
|
|
export async function fetchFavoriteShips() {
|
|
const response = await fetchWithAuth('/api/gis/my/dashboard/ship/attention/static/search');
|
|
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
|
const result = await response.json();
|
|
return result?.data || [];
|
|
}
|
|
|
|
/**
|
|
* 관심구역 목록 조회
|
|
* @returns {Promise<Array>} 관심구역 목록
|
|
*/
|
|
export async function fetchRealms() {
|
|
const response = await fetchWithAuth('/api/gis/sea-relm/manage/show', {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body: JSON.stringify({}),
|
|
});
|
|
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
|
const result = await response.json();
|
|
return result?.seaRelmManageShowDtoList || [];
|
|
}
|