japan-map-selector
Version:
Interactive Japan map component for selecting prefectures and municipalities
56 lines (55 loc) • 2.22 kB
TypeScript
import { JapanMapSelectorProps, MapState, Prefecture, Municipality, ColorTheme } from '../types';
export declare class JapanMapSelector {
private prefectures;
private municipalities;
private municipalitiesCache;
private state;
private listeners;
private props;
private currentProjection;
private theme;
private currentThemeName;
private deformer;
private deformMode;
private isDynamicLoadingEnabled;
constructor(props?: JapanMapSelectorProps);
initialize(prefectureDataUrl: string, municipalityDataUrl: string): Promise<void>;
private calculateOptimalProjection;
on(event: string, listener: Function): void;
off(event: string, listener: Function): void;
emit(event: string, data?: any): void;
isPrefectureSelectable(prefectureCode: string): boolean;
selectPrefecture(prefectureCode: string): Promise<void>;
selectMunicipality(municipalityCode: string): void;
getPrefectures(): Prefecture[];
getSelectedMunicipalities(): Municipality[];
getPrefecturePath(prefecture: Prefecture): string;
private filterTokyoMainlandOnly;
private filterGeometryByLongitude;
private filterGeometryByLatitude;
private filterGeometryByBounds;
private filterHokkaidoMainland;
getOkinawaFrame(): {
x: number;
y: number;
width: number;
height: number;
} | null;
private projectPoint;
getMunicipalityPath(municipality: Municipality): string;
hoverPrefecture(prefectureCode: string | null): void;
hoverMunicipality(municipalityCode: string | null): void;
resetView(): void;
toggleTokyoIslands(): void;
getState(): MapState;
getProps(): JapanMapSelectorProps;
getTheme(): ColorTheme;
setTheme(themeNameOrObject: ColorTheme | string): void;
setDeformMode(mode: 'none' | 'grid' | 'hexagon', gridSize?: number): void;
private getDeformedPrefecture;
private getDeformedMunicipality;
getPrefectureFillColor(prefecture: Prefecture): string;
getPrefectureStrokeColor(prefecture: Prefecture): string;
getMunicipalityFillColor(municipality: Municipality): string;
getMunicipalityHoverFillColor(municipality: Municipality): string;
}