diff --git a/types/navermaps/index.d.ts b/types/navermaps/index.d.ts index 994c7218ff..92409a44b0 100644 --- a/types/navermaps/index.d.ts +++ b/types/navermaps/index.d.ts @@ -7,28 +7,28 @@ declare namespace naver.maps { * Types */ type PointArrayLiteral = [number, number]; - type PointLiteral = naver.maps.PointArrayLiteral | naver.maps.PointObjectLiteral; + type PointLiteral = PointArrayLiteral | PointObjectLiteral; type SizeArrayLiteral = [number, number]; - type SizeLiteral = naver.maps.SizeArrayLiteral | naver.maps.SizeObjectLiteral; - type LatLngLiteral = naver.maps.PointLiteral | naver.maps.LatLngObjectLiteral; + type SizeLiteral = SizeArrayLiteral | SizeObjectLiteral; + type LatLngLiteral = PointLiteral | LatLngObjectLiteral; type PointBoundsArrayLiteral = [number, number, number, number]; - type PointBoundsLiteral = naver.maps.PointBoundsArrayLiteral | naver.maps.PointBoundsObjectLiteral; - type LatLngBoundsLiteral = naver.maps.PointBoundsLiteral | naver.maps.LatLngBoundsObjectLiteral; - type BoundsLiteral = naver.maps.PointBoundsLiteral | naver.maps.LatLngBoundsLiteral; - type CoordLiteral = naver.maps.PointLiteral | naver.maps.LatLngLiteral; - type Coord = naver.maps.Point | naver.maps.LatLng; - type Bounds = naver.maps.PointBounds | naver.maps.LatLngBounds; + type PointBoundsLiteral = PointBoundsArrayLiteral | PointBoundsObjectLiteral; + type LatLngBoundsLiteral = PointBoundsLiteral | LatLngBoundsObjectLiteral; + type BoundsLiteral = PointBoundsLiteral | LatLngBoundsLiteral; + type CoordLiteral = PointLiteral | LatLngLiteral; + type Coord = Point | LatLng; + type Bounds = PointBounds | LatLngBounds; type DOMEvent = Event; - type StylingFunction = (feature: naver.maps.Feature) => naver.maps.StyleOptions; - type ArrayOfCoords = naver.maps.Point[] | naver.maps.LatLng[]; - type ArrayOfBounds = naver.maps.PointBounds[] | naver.maps.LatLngBounds[]; - type ArrayOfBoundsLiteral = naver.maps.PointBoundsLiteral[] | naver.maps.LatLngBoundsLiteral[]; - type forEachOverlayCallback = (overlay: naver.maps.Marker | naver.maps.Polyline | naver.maps.Polygon, index: number) => void; - type GeoJSON = object; - type GPX = object; - type KML = object; + type StylingFunction = (feature: Feature) => StyleOptions; + type ArrayOfCoords = Point[] | LatLng[]; + type ArrayOfBounds = PointBounds[] | LatLngBounds[]; + type ArrayOfBoundsLiteral = PointBoundsLiteral[] | LatLngBoundsLiteral[]; + type forEachOverlayCallback = (overlay: Marker | Polyline | Polygon, index: number) => void; + type GeoJSON = any; + type GPX = any; + type KML = any; type KVOArrayOfCoords = any; - type ArrayOfCoordsLiteral = naver.maps.PointLiteral[] | naver.maps.LatLngLiteral[]; + type ArrayOfCoordsLiteral = PointLiteral[] | LatLngLiteral[]; type strokeStyleType = 'solid' | 'shortdash' | 'shortdot' | 'shortdashdot' | 'shortdashdotdot' | 'dot' | 'dash' | 'longdash' | 'dashdot' | 'longdashdot' | 'longdashdotdot'; type strokeLineCapType = 'butt' | 'round' | 'square'; @@ -37,46 +37,51 @@ declare namespace naver.maps { /** * Interfaces */ - export interface PointObjectLiteral { + interface MapEventListener { + eventName: string; + listener: () => any; + listenerId: string; + target: any; + } + interface PointObjectLiteral { x: number; y: number; } - export interface SizeObjectLiteral { + interface SizeObjectLiteral { width: number; height: number; } - export interface LatLngObjectLiteral { + interface LatLngObjectLiteral { lat: number; lng: number; } - export interface PointBoundsObjectLiteral { + interface PointBoundsObjectLiteral { minX: number; minY: number; maxX: number; maxY: number; } - export interface LatLngBoundsObjectLiteral { + interface LatLngBoundsObjectLiteral { north: number; east: number; south: number; west: number; } - export interface MapSystemProjection extends KVO { + interface MapSystemProjection extends KVO { factor(zoom: number): number; - fromCoordToOffset(coord: naver.maps.Coord): naver.maps.Point; - fromCoordToPoint(coord: naver.maps.Coord): naver.maps.Point; - fromOffsetToCoord(offset: naver.maps.Point): naver.maps.Coord; - fromOffsetToPoint(offset: naver.maps.Point): naver.maps.Point; - fromPointToCoord(point: naver.maps.Point): naver.maps.Coord; - fromPointToOffset(point: naver.maps.Point): naver.maps.Point; - getDestinationCoord(fromCoord: naver.maps.Coord, angle: number, meter: number): naver.maps.Coord; - getDistance(coord1: naver.maps.Coord, coord2: naver.maps.Coord): number; + fromCoordToOffset(coord: Coord): Point; + fromCoordToPoint(coord: Coord): Point; + fromOffsetToCoord(offset: Point): Coord; + fromOffsetToPoint(offset: Point): Point; + fromPointToCoord(point: Point): Coord; + fromPointToOffset(point: Point): Point; + getDestinationCoord(fromCoord: Coord, angle: number, meter: number): Coord; + getDistance(coord1: Coord, coord2: Coord): number; getProjectionName(): number; - scaleDown(operand: number | naver.maps.Point | naver.maps.Size, zoom: number): number | naver.maps.Point | naver.maps.Size; - scaleUp(operand: number | naver.maps.Point | naver.maps.Size, zoom: number): number | naver.maps.Point | naver.maps.Size; - + scaleDown(operand: number | Point | Size, zoom: number): number | Point | Size; + scaleUp(operand: number | Point | Size, zoom: number): number | Point | Size; } - export interface MapOptions { + interface MapOptions { background?: string; baseTileOpacity?: number; bounds?: any; @@ -113,7 +118,7 @@ declare namespace naver.maps { zoomControlOptions?: any; zoomOrigin?: any; } - export interface MarkerOptions { + interface MarkerOptions { animation?: any; map?: Map; position?: any; @@ -126,344 +131,349 @@ declare namespace naver.maps { visible?: boolean; zIndex?: number; } - export interface MapPanes { + interface MapPanes { overlayLayer: HTMLElement; overlayImage: HTMLElement; floatPane: HTMLElement; } - export interface MapEventListener { - eventName: string; - listener: Function; - listenerId: string; - target: object; - } - export interface InfoWindowOptions { - position: naver.maps.Coord | naver.maps.CoordLiteral; + interface InfoWindowOptions { + position?: Coord | CoordLiteral; content: string | HTMLElement; zIndex?: number; maxWidth?: number; - pixelOffset?: naver.maps.Point | naver.maps.PointLiteral; + pixelOffset?: Point | PointLiteral; backgroundColor?: string; borderColor?: string; borderWidth?: number; disableAutoPan?: boolean; disableAnchor?: boolean; anchorSkew?: boolean; - anchorSize?: naver.maps.Size | naver.maps.SizeLiteral; + anchorSize?: Size | SizeLiteral; anchorColor?: string; } - export interface ImageTileOptions { + interface ImageTileOptions { urls: string[]; - imgonload?: Function; - imgonerror?: Function; + imgonload?: () => any; + imgonerror?: () => any; opacity?: number; transition?: boolean; - offset?: naver.maps.Point; + offset?: Point; zIndex?: number; - size?: naver.maps.Size; + size?: Size; pane?: HTMLElement; } - export interface ImageMapTypeOptions { + interface ImageMapTypeOptions { name: string; maxZoom: number; minZoom: number; - projection: naver.maps.Projection; - tileSize?: naver.maps.Size | naver.maps.SizeLiteral; + projection: Projection; + tileSize?: Size | SizeLiteral; repeatX?: boolean; vendor?: string; - provider?: naver.maps.MapDataProvider; + provider?: MapDataProvider[]; uid?: string; darktheme?: boolean; - getTileUrl?: Function; + getTileUrl?: () => any; tileSet?: string | string[]; } - export interface GroundOverlayOptions { + interface GroundOverlayOptions { clickable?: boolean; - map?: naver.maps.Map | null; + map?: Map | null; opacity?: number; } - export interface EllipseOptions { - map?: naver.maps.Map; - bounds: naver.maps.Bounds | naver.maps.BoundsLiteral; + interface EllipseOptions { + map?: Map; + bounds: Bounds | BoundsLiteral; strokeWeight?: number; strokeOpacity?: number; strokeColor?: string; - strokeStyle?: naver.maps.strokeStyleType; - strokeLineCap?: naver.maps.strokeLineCapType; - strokeLineJoin?: naver.maps.strokeLineJoinType; + strokeStyle?: strokeStyleType; + strokeLineCap?: strokeLineCapType; + strokeLineJoin?: strokeLineJoinType; fillColor?: string; fillOpacity?: number; clickable?: boolean; visible?: boolean; zIndex?: number; } - export interface FeatureEvent { - feature: naver.maps.Feature; + interface FeatureEvent { + feature: Feature; } - export interface PointerEvent { - coord: naver.maps.Coord; - point: naver.maps.Point; - offset: naver.maps.Point; - pointerEvent: naver.maps.DOMEvent; - feature: naver.maps.Feature; + interface PointerEvent { + coord: Coord; + point: Point; + offset: Point; + pointerEvent: DOMEvent; + feature: Feature; } - export interface PropertyEvent { - feature: naver.maps.Feature; + interface PropertyEvent { + feature: Feature; name: string; oldValue: any; newValue: any; } - export interface StyleOptions { + interface StyleOptions { strokeColor?: string; strokeOpacity?: number; strokeWeight?: number; fillColor?: string; fillOpacity?: number; clickable?: boolean; - icon?: string | naver.maps.ImageIcon | naver.maps.SymbolIcon | naver.maps.HtmlIcon; - shape?: naver.maps.MarkerShape; + icon?: string | ImageIcon | SymbolIcon | HtmlIcon; + shape?: MarkerShape; title?: string; visible?: boolean; zIndex?: number; } - export interface ControlOptions { - position: naver.maps.Position; + interface ControlOptions { + position: Position; } - export interface CircleOptions { - map?: naver.maps.Map; - center: naver.maps.Coord | naver.maps.CoordLiteral; + interface CircleOptions { + map?: Map; + center: Coord | CoordLiteral; radius?: number; strokeWeight?: number; strokeOpacity?: number; strokeColor?: string; - strokeStyle?: naver.maps.strokeStyleType; - strokeLineCap?: naver.maps.strokeLineCapType; - strokeLineJoin?: naver.maps.strokeLineJoinType; + strokeStyle?: strokeStyleType; + strokeLineCap?: strokeLineCapType; + strokeLineJoin?: strokeLineJoinType; fillColor?: string; fillOpacity?: number; clickable?: boolean; visible?: boolean; zIndex?: number; } - export interface TileOptions { + interface TileOptions { opacity?: number; transition?: boolean; - offset?: naver.maps.Point; + offset?: Point; zIndex?: number; - size?: naver.maps.Size; + size?: Size; pane?: HTMLElement; } - export interface TileIndex { + interface TileIndex { xIndex: number; yIndex: number; } - export interface CanvasTileOptions { + interface CanvasTileOptions { imageData?: ImageData; opacity?: number; transition?: boolean; - offset?: naver.maps.Point; + offset?: Point; zIndex?: number; - size?: naver.maps.Size; + size?: Size; pane?: HTMLElement; } - export interface CanvasMapTypeOptions { + interface CanvasMapTypeOptions { name: string; maxZoom: number; minZoom: number; - projection: naver.maps.Projection; - tileSize?: naver.maps.Size | naver.maps.SizeLiteral; + projection: Projection; + tileSize?: Size | SizeLiteral; repeatX?: boolean; vendor?: string; - provider?: naver.maps.MapDataProvider; + provider?: MapDataProvider[]; uid?: string; darktheme?: boolean; - getTileData?: Function; + getTileData?: () => any; } - export interface MapDataProvider { + interface MapDataProvider { title: string; - link: string; - bounds: naver.maps.Bounds | naver.maps.BoundsLiteral | naver.maps.ArrayOfBounds | naver.maps.ArrayOfBoundsLiteral; + link?: string; + bounds?: Bounds | BoundsLiteral | ArrayOfBounds | ArrayOfBoundsLiteral; } - export interface MapType { + interface MapType { maxZoom: number; minZoom: number; name: string; - projection: naver.maps.Projection; - tileSize: naver.maps.Size; - getTile(x: number, y: number, z: number): HTMLElement | naver.maps.Tile; + projection: Projection; + tileSize: Size; + getTile(x: number, y: number, z: number): HTMLElement | Tile; } - export interface Projection { - fromCoordToPoint(coord: naver.maps.Coord): naver.maps.Point; - fromPointToCoord(point: naver.maps.Point): Coord; + interface Projection { + fromCoordToPoint(coord: Coord): Point; + fromPointToCoord(point: Point): Coord; } - export interface CadastralLayerOptions { - overlayMap?: boolean; - zIndex?: number; + interface CadastralLayerOptions { + overlayMap: boolean | undefined; + zIndex: number | undefined; } - export interface AroundControlOptions { - position: naver.maps.Position; + interface AroundControlOptions { + position: Position; } - export interface NaverImageMapTypeOptions { + interface NaverImageMapTypeOptions { maxZoom?: number; minZoom?: number; - projection?: naver.maps.Projection; - tileSize?: naver.maps.Size; + projection?: Projection; + tileSize?: Size; hd?: string; } - export interface LogoControlOptions { - position: naver.maps.Position; + interface LogoControlOptions { + position: Position; } - export interface MapDataControlOptions { - position: naver.maps.Position; + interface MapDataControlOptions { + position: Position; } - export interface MapTypeControlOptions { - mapTypeIds: naver.maps.MapTypeId[] | null; - position: naver.maps.Position; - style: naver.maps.MapTypeControlStyle; + interface MapTypeControlOptions { + mapTypeIds: MapTypeId[] | null; + position: Position; + style: MapTypeControlStyle; } - export interface ScaleControlOptions { - position: naver.maps.Position; + interface ScaleControlOptions { + position: Position; } - export interface ZoomControlOptions { - position: naver.maps.Position; - style: naver.maps.ZoomControlStyle; + interface ZoomControlOptions { + position: Position; + style: ZoomControlStyle; legendDisabled: boolean; } - export interface LayerOptions { + interface LayerOptions { hd: boolean; - overlayMap: boolean; - zIndex: number; + overlayMap: boolean | undefined; + zIndex: number | undefined; } - export interface CadastralLayerOptions { - overlayMap: boolean; - zIndex: number; + interface CadastralLayerOptions { + overlayMap: boolean | undefined; + zIndex: number | undefined; } - export interface StreetLayerOptions { - overlayMap: boolean; - zIndex: number; + interface StreetLayerOptions { + overlayMap: boolean | undefined; + zIndex: number | undefined; } - export interface TrafficLayerOptions { + interface TrafficLayerOptions { interval: number; - overlayMap: boolean; - zIndex: number; + overlayMap: boolean | undefined; + zIndex: number | undefined; } - export interface HtmlIcon { + interface HtmlIcon { content: string | HTMLElement; - size?: naver.maps.Size | naver.maps.SizeLiteral; - anchor?: naver.maps.Point | naver.maps.PointLiteral | naver.maps.Position; + size?: Size | SizeLiteral; + anchor?: Point | PointLiteral | Position; } - export interface ImageIcon { + interface ImageIcon { url: string; - size?: naver.maps.Size | naver.maps.SizeLiteral; - scaledSize?: naver.maps.Size |naver.maps. SizeLiteral; - origin?: naver.maps.Point | naver.maps.PointLiteral; - anchor?: naver.maps.Point | naver.maps.PointLiteral | naver.maps.Position; + size?: Size | SizeLiteral; + scaledSize?: Size | SizeLiteral; + origin?: Point | PointLiteral; + anchor?: Point | PointLiteral | Position; } - export interface MarkerShape { + interface MarkerShape { coords: any[]; type: string; } - export interface SymbolIcon { - path: naver.maps.SymbolPath | naver.maps.Point[] | naver.maps.PointLiteral[]; - style?: naver.maps.SymbolStyle; + interface SymbolIcon { + path: SymbolPath | Point[] | PointLiteral[]; + style?: SymbolStyle; radius?: number; fillColor?: string; fillOpacity?: number; strokeColor?: string; strokeWeight?: number; strokeOpacity?: number; - anchor?: naver.maps.Point | naver.maps.PointLiteral | naver.maps.Position; + anchor?: Point | PointLiteral | Position; } - export interface PolygonOptions { - map?: naver.maps.Map; - paths: naver.maps.ArrayOfCoords[] | naver.maps.KVOArrayOfCoords[] | naver.maps.ArrayOfCoordsLiteral[]; + interface PolygonOptions { + map?: Map; + paths: ArrayOfCoords[] | KVOArrayOfCoords[] | ArrayOfCoordsLiteral[]; strokeWeight?: number; strokeOpacity?: number; strokeColor?: string; - strokeStyle?: naver.maps.strokeStyleType; - strokeLineCap?: naver.maps.strokeLineCapType; - strokeLineJoin?: naver.maps.strokeLineJoinType; + strokeStyle?: strokeStyleType; + strokeLineCap?: strokeLineCapType; + strokeLineJoin?: strokeLineJoinType; fillColor?: string; fillOpacity?: number; clickable?: boolean; visible?: boolean; zIndex?: number; } - export interface PolylineOptions { - map?: naver.maps.Map; - path: naver.maps.ArrayOfCoords | naver.maps.KVOArrayOfCoords | naver.maps.ArrayOfCoordsLiteral; + interface PolylineOptions { + map?: Map; + path: ArrayOfCoords | KVOArrayOfCoords | ArrayOfCoordsLiteral; strokeWeight?: number; strokeOpacity?: number; strokeColor?: string; - strokeStyle?: naver.maps.strokeStyleType; - strokeLineCap?: naver.maps.strokeLineCapType; - strokeLineJoin?: naver.maps.strokeLineJoinType; + strokeStyle?: strokeStyleType; + strokeLineCap?: strokeLineCapType; + strokeLineJoin?: strokeLineJoinType; clickable?: boolean; visible?: boolean; zIndex?: number; - startIcon?: naver.maps.PointingIcon; + startIcon?: PointingIcon; startIconSize?: number; - endIcon?: naver.maps.PointingIcon; + endIcon?: PointingIcon; endIconSize?: number; } - export interface RectangleOptions { - map?: naver.maps.Map; - bounds: naver.maps.Bounds | naver.maps.BoundsLiteral; + interface RectangleOptions { + map?: Map; + bounds: Bounds | BoundsLiteral; strokeWeight?: number; strokeOpacity?: number; strokeColor?: string; - strokeStyle?: naver.maps.strokeStyleType; - strokeLineCap?: naver.maps.strokeLineCapType; - strokeLineJoin?: naver.maps.strokeLineJoinType; + strokeStyle?: strokeStyleType; + strokeLineCap?: strokeLineCapType; + strokeLineJoin?: strokeLineJoinType; fillColor?: string; fillOpacity?: number; clickable?: boolean; visible?: boolean; zIndex?: number; } - export interface PanoramaOptions { - size: naver.maps.Size | naver.maps.SizeLiteral; + interface PanoramaOptions { + size: Size | SizeLiteral; panoId: string; - position: naver.maps.LatLng | naver.maps.LatLngLiteral; - pov: naver.maps.PanoramaPov; + position: LatLng | LatLngLiteral; + pov: PanoramaPov; visible: boolean; minScale: number; maxScale: number; minZoom: number; maxZoom: number; logoControl: boolean; - logoControlOptions: naver.maps.LogoControlOptions; + logoControlOptions: LogoControlOptions; zoomControl: boolean; - zoomControlOptions: naver.maps.ZoomControlOptions; + zoomControlOptions: ZoomControlOptions; aroundControl: boolean; - aroundControlOptions: naver.maps.AroundControlOptions; + aroundControlOptions: AroundControlOptions; } - export interface PanoramaPov { + interface PanoramaPov { pan: number; tilt: number; fov: number; } - export interface PanoramaLocation { + interface PanoramaLocation { panoId: string; title: string; address: string; - coord: naver.maps.LatLng; + coord: LatLng; photodate: string; } - export interface DOMEventListener { + interface DOMEventListener { eventName: string; - listener: Function; + listener: () => any; target: HTMLElement; } + interface Margin { + top?: number; + right?: number; + bottom?: number; + left?: number; + } + + interface TransitionOptions { + duration?: number; + easing?: string; + } /** * Enums */ - export enum MapTypeControlStyle { + enum MapTypeControlStyle { BUTTON, DROPDOWN } - export enum ZoomControlStyle { + enum ZoomControlStyle { LARGE, SMALL } @@ -471,25 +481,26 @@ declare namespace naver.maps { /** * Members */ - export enum Animation { + enum Animation { BOUNCE = 1, DROP } let jsContentLoaded: boolean; - export enum MapTypeId { // TODO. 확실하지 않음 - NORMAL, - TERRAIN, - SATELLITE, - HYBRID + type MapTypeId = string; + namespace MapTypeId { // TODO. 확실하지 않음 + let NORMAL: string; + let TERRAIN: string; + let SATELLITE: string; + let HYBRID: string; } - export function onJSContentLoaded(...args: any[]): any; - export enum PointingIcon { + function onJSContentLoaded(...args: any[]): any; + enum PointingIcon { OPEN_ARROW = 1, BLOCK_ARROW, CIRCLE, DIAMOND } - export enum Position { + enum Position { CENTER = 0, TOP_LEFT, TOP_CENTER, @@ -504,39 +515,40 @@ declare namespace naver.maps { BOTTOM_CENTER, BOTTOM_RIGHT } - export enum SymbolPath { + enum SymbolPath { BACKWARD_CLOSED_ARROW = 1, BACKWARD_OPEN_ARROW, CIRCLE, FORWARD_CLOSED_ARROW, FORWARD_OPEN_ARROW } - export enum SymbolStyle { - CIRCLE = 'circle', - PATH = 'path', - CLOSED_PATH = 'closedPath' + type SymbolStyle = string; + namespace SymbolStyle { + let CIRCLE: string; + let PATH: string; + let CLOSED_PATH: string; } /** * Classes */ - // KVO - export class KVO { + // KVO + class KVO { constructor(); - addListener(eventName: any, listener: Function): naver.maps.MapEventListener; - addListenerOnce(eventName: string | any, listener: Function): naver.maps.MapEventListener; - bindTo(key: string, target: naver.maps.KVO, targetKey?: string): void; + addListener(eventName: any, listener: () => any): MapEventListener; + addListenerOnce(eventName: any, listener: () => any): MapEventListener; + bindTo(key: string, target: KVO, targetKey?: string): void; clearListeners(eventName: string): void; get(key: string): any; hasListener(eventName: string): boolean; - removeListener(listeners: naver.maps.MapEventListener | MapEventListener[]): void; + removeListener(listeners: MapEventListener | MapEventListener[]): void; set(key: string, value: any, silently?: boolean): void; - setValues(properties: object): void; + setValues(properties: any): void; trigger(eventName: string, eventObject?: any): void; unbind(key: string): void; unbindAll(): void; } - export class KVOArray extends naver.maps.KVO { + class KVOArray extends KVO { constructor(array: any[]); clear(): void; forEach(callback: (element: any, index: number) => void): void; @@ -553,533 +565,559 @@ declare namespace naver.maps { splice(startIndex: number, deleteCount: number, element?: any): any[]; } // Base - export class Point { + class Point { constructor(x: number, y: number); - add(point: naver.maps.Coord | naver.maps.PointLiteral): naver.maps.Point; - add(x: number, y: number): naver.maps.Point; - ceil(): naver.maps.Point; - clone(): naver.maps.Point; - div(point: naver.maps.Coord | naver.maps.PointLiteral); - div(x: number, y: number): naver.maps.Point; - equals(point: naver.maps.Point): boolean; - floor(): naver.maps.Point; - mul(point: naver.maps.Coord | naver.maps.PointLiteral): naver.maps.Point; - mul(x: number, y: number): naver.maps.Point; - round(): naver.maps.Point; - sub(point: naver.maps.Coord | naver.maps.PointLiteral): naver.maps.Point; - sub(x: number, y: number): naver.maps.Point; + add(point: Coord | PointLiteral): Point; + add(x: number, y: number): Point; + ceil(): Point; + clone(): Point; + div(point: Coord | PointLiteral): void; + div(x: number, y: number): Point; + equals(point: Point): boolean; + floor(): Point; + mul(point: Coord | PointLiteral): Point; + mul(x: number, y: number): Point; + round(): Point; + sub(point: Coord | PointLiteral): Point; + sub(x: number, y: number): Point; toString(): string; } - export class Size { + class Size { + width: number; + height: number; constructor(width: number, height: number); - add(size: naver.maps.Size | naver.maps.SizeLiteral): naver.maps.Size; - add(width: number, height: number): naver.maps.Size; - ceil(): naver.maps.Size; - clone(): naver.maps.Size; - div(width: number, height: number): naver.maps.Size; - div(size: naver.maps.Size | naver.maps.SizeLiteral): naver.maps.Size; - equals(size: naver.maps.Size | naver.maps.SizeLiteral): boolean; - floor(): naver.maps.Size; - mul(size: naver.maps.Size | naver.maps.SizeLiteral): naver.maps.Size; - mul(width: number, height: number): naver.maps.Size; - round(): naver.maps.Size; - sub(size: naver.maps.Size | naver.maps.SizeLiteral): naver.maps.Size; - sub(width: number, height: number): naver.maps.Size; + add(size: Size | SizeLiteral): Size; + add(width: number, height: number): Size; + ceil(): Size; + clone(): Size; + div(width: number, height: number): Size; + div(size: Size | SizeLiteral): Size; + equals(size: Size | SizeLiteral): boolean; + floor(): Size; + mul(size: Size | SizeLiteral): Size; + mul(width: number, height: number): Size; + round(): Size; + sub(size: Size | SizeLiteral): Size; + sub(width: number, height: number): Size; toString(): string; } - export class PointBounds { - constructor(minPoint: naver.maps.Point, maxPoint: naver.maps.Point); - static bounds(point: naver.maps.Coord | naver.maps.PointLiteral, - pointN: naver.maps.Coord | naver.maps.PointLiteral): naver.maps.PointBounds; - clone(): naver.maps.PointBounds; - equals(bounds: naver.maps.Bounds | naver.maps.PointBoundsLiteral): boolean; - extend(point: naver.maps.Coord | naver.maps.PointLiteral): naver.maps.PointBounds; - getCenter(): naver.maps.Point; - getMax(): naver.maps.Point; - getMin(): naver.maps.Point; - hasBounds(bounds: naver.maps.Bounds | naver.maps.PointBoundsLiteral): boolean; - hasPoint(point: naver.maps.Coord | naver.maps.PointLiteral): boolean; - intersects(bounds: naver.maps.Bounds | naver.maps.PointBoundsLiteral): boolean; + class PointBounds { + constructor(minPoint: Point, maxPoint: Point); + static bounds(point: Coord | PointLiteral, + pointN: Coord | PointLiteral): PointBounds; + clone(): PointBounds; + equals(bounds: Bounds | PointBoundsLiteral): boolean; + extend(point: Coord | PointLiteral): PointBounds; + getCenter(): Point; + getMax(): Point; + getMin(): Point; + hasBounds(bounds: Bounds | PointBoundsLiteral): boolean; + hasPoint(point: Coord | PointLiteral): boolean; + intersects(bounds: Bounds | PointBoundsLiteral): boolean; maxX(): number; maxY(): number; minX(): number; minY(): number; toString(): string; - union(bounds: naver.maps.Bounds | naver.maps.PointBoundsLiteral): naver.maps.PointBounds; + union(bounds: Bounds | PointBoundsLiteral): PointBounds; } - export class LatLng extends Point { + class LatLng extends Point { constructor(lat: number, lng: number); - clone(): naver.maps.LatLng; - destinationPoint(angle: number, meter: number): naver.maps.LatLng; - equals(point: naver.maps.Coord | naver.maps.LatLngLiteral): boolean; + clone(): LatLng; + destinationPoint(angle: number, meter: number): LatLng; + equals(point: Coord | LatLngLiteral): boolean; lat(): number; lng(): number; - toPoint(): naver.maps.Point; + toPoint(): Point; toString(): string; } - export class LatLngBounds extends PointBounds { - constructor(sw: naver.maps.LatLng, ne: naver.maps.LatLng); - static bounds(latlng: naver.maps.Coord | naver.maps.LatLngLiteral, - latlngN: naver.maps.Coord | naver.maps.LatLngLiteral): naver.maps.LatLngBounds; - clone(): naver.maps.LatLngBounds; + class LatLngBounds extends PointBounds { + constructor(sw: LatLng, ne: LatLng); + static bounds(latlng: Coord | LatLngLiteral, + latlngN: Coord | LatLngLiteral): LatLngBounds; + clone(): LatLngBounds; east(): number; - equals(bounds: naver.maps.Bounds | naver.maps.LatLngBoundsLiteral): boolean; - extend(latlng: naver.maps.Coord | naver.maps.LatLngLiteral): naver.maps.LatLngBounds; - getCenter(): naver.maps.LatLng; - getNE(): naver.maps.LatLng; - getSW(): naver.maps.LatLng; - hasLatLng(latlng: naver.maps.Coord | naver.maps.LatLngLiteral): boolean; - intersects(bounds: naver.maps.Bounds | naver.maps.LatLngBoundsLiteral): boolean; + equals(bounds: Bounds | LatLngBoundsLiteral): boolean; + extend(latlng: Coord | LatLngLiteral): LatLngBounds; + getCenter(): LatLng; + getNE(): LatLng; + getSW(): LatLng; + hasLatLng(latlng: Coord | LatLngLiteral): boolean; + intersects(bounds: Bounds | LatLngBoundsLiteral): boolean; north(): number; south(): number; - toPointBounds(): naver.maps.PointBounds; - union(bounds: naver.maps.Bounds | naver.maps.LatLngBoundsLiteral): naver.maps.LatLngBounds; + toPointBounds(): PointBounds; + union(bounds: Bounds | LatLngBoundsLiteral): LatLngBounds; west(): number; } // Map - export class Map { + class Map extends KVO { controls: any; data: any; layers: any; mapTypes: any; mapSystemProjection: any; - constructor(mapDiv: string, mapOptions: MapOptions); + constructor(mapDiv: string, mapOptions?: MapOptions); addPane(name: string, elementOrIndex: HTMLElement | number): void; destory(): void; - fitBounds(bounds: any, margin: any): void; - getBounds(): any; - getSize(): any; + fitBounds(bounds: any, margin?: any): void; + getBounds(): Bounds; + getCenter(): Coord; + getCenterPoint(): Coord; + getElement(): HTMLElement; + getMapTypeId(): string; + getOptions(key?: string): any; + getPanes(): MapPanes; + getPrimitiveProjection(): Projection; + getProjection(): MapSystemProjection; + getSize(): Size; + getZoom(): number; + morph(coord: Coord | CoordLiteral, zoom?: number, transitionOptions?: TransitionOptions): void; + panBy(offset: Point | PointLiteral): void; + panTo(coord: Coord | CoordLiteral, transitionOptions: TransitionOptions): void; + panToBounds(bounds: Bounds | BoundsLiteral, transitionOptions: TransitionOptions, margin?: Margin): void; + refresh(noEffect?: boolean): void; + removePane(name: string): void; + setCenter(center: Coord | CoordLiteral): void; + setCenterPoint(point: Point | PointLiteral): void; + setMapTypeId(mapTypeId: string): void; + setOptions(newOptionsOrKey: any, value?: any): void; + setSize(size: Size | SizeLiteral): void; + setZoom(zoom: number, effect?: boolean): void; + updateBy(coord: Coord | CoordLiteral, zoom: number): void; + zoomBy(deltaZoom: number, zoomOrigin?: Coord | CoordLiteral, effect?: boolean): void; } // Map.Tile - export class Tile extends naver.maps.KVO { - constructor(element: HTMLElement, tileOptions?: naver.maps.TileOptions); + class Tile extends KVO { + constructor(element: HTMLElement, tileOptions?: TileOptions); appendTo(parentNode: HTMLElement): void; cancelFadeIn(): void; destroy(): void; - fadeIn(callback: Function, startOpacity?: number): void; + fadeIn(callback: () => any, startOpacity?: number): void; getElement(): HTMLElement; - getOffset(): naver.maps.Point; + getOffset(): Point; getOpacity(): number; - getSize(): naver.maps.Size; - getTileIndex(): naver.maps.TileIndex; + getSize(): Size; + getTileIndex(): TileIndex; getZIndex(): number; hide(): void; - load(tileOptions?: naver.maps.TileOptions): void; + load(tileOptions?: TileOptions): void; remove(): void; - reset(mapType: naver.maps.MapType, zoom: number, tileOptions?: naver.maps.TileOptions): void; + reset(mapType: MapType, zoom: number, tileOptions?: TileOptions): void; setBlank(): void; - setOffset(offset: naver.maps.Point): void; + setOffset(offset: Point): void; setOffset(x: number, y: number): void; setOpacity(opacity: number): void; - setSize(size: naver.maps.Size): void; - setTileIndex(tileIndex: naver.maps.TileIndex): void; + setSize(size: Size): void; + setTileIndex(tileIndex: TileIndex): void; setZIndex(zIndex: number): void; show(): void; - } - export class CanvasTile extends naver.maps.Tile { - constructor(canvasTileOptions: naver.maps.CanvasTileOptions); + class CanvasTile extends Tile { + constructor(canvasTileOptions: CanvasTileOptions); } - export class ImageTile extends naver.maps.Tile { - constructor(imageTileOptions: naver.maps.ImageTileOptions); + class ImageTile extends Tile { + constructor(imageTileOptions: ImageTileOptions); getImageElements(): HTMLElement[]; getUrls(): string[]; setUrls(urls: string[]): void; } // Map.MapType - export class CanvasMapType implements naver.maps.MapType { + class CanvasMapType implements MapType { maxZoom: number; minZoom: number; name: string; - projection: naver.maps.Projection; - tileSize: naver.maps.Size; - constructor(canvasMapTypeOptions: naver.maps.CanvasMapTypeOptions); - getMapTypeOptions(): naver.maps.CanvasMapTypeOptions; + projection: Projection; + tileSize: Size; + constructor(canvasMapTypeOptions: CanvasMapTypeOptions); + getMapTypeOptions(): CanvasMapTypeOptions; getMaxZoom(): number; getMinZoom(): number; getName(): string; - getTile(x: number, y: number, z: number): naver.maps.CanvasTile; + getTile(x: number, y: number, z: number): CanvasTile; getTileData(x: number, y: number, z: number): ImageData; - setMapTypeOptions(canvasMapTypeOptions: naver.maps.CanvasMapTypeOptions): void; + setMapTypeOptions(canvasMapTypeOptions: CanvasMapTypeOptions): void; } - export class ImageMapType implements naver.maps.MapType { + class ImageMapType implements MapType { maxZoom: number; minZoom: number; name: string; - projection: naver.maps.Projection; - tileSize: naver.maps.Size; - constructor(imageMapTypeOptions); - getMapTypeOptions(): naver.maps.ImageMapTypeOptions; + projection: Projection; + tileSize: Size; + constructor(imageMapTypeOptions: ImageMapTypeOptions); + getMapTypeOptions(): ImageMapTypeOptions; getMaxZoom(): number; getMinZoom(): number; getName(): string; - getTile(x: number, y: number, z: number): naver.maps.ImageTile; + getTile(x: number, y: number, z: number): ImageTile; getTileUrls(x: number, y: number, z: number): string[]; - setMapTypeOptions(imageMapTypeOptions: naver.maps.ImageMapTypeOptions): void; + setMapTypeOptions(imageMapTypeOptions: ImageMapTypeOptions): void; } - export class MapTypeRegistry extends naver.maps.KVO { - constructor(mapTypeInfo: object, defaultMapTypeId?: string); + class MapTypeRegistry extends KVO { + constructor(mapTypeInfo?: any, defaultMapTypeId?: string); getPreviousTypeId(): string; - getSelectedType(): naver.maps.MapType; + getSelectedType(): MapType; getSelectedTypeId(): string; getTypeIds(): string[]; - set(mapTypeId: string, mapType: naver.maps.MapType): void; + set(mapTypeId: string, mapType: MapType): void; setSelectedTypeId(mapTypeId: string): void; } + // Map.MapType.Preset - export class NaverMapTypeOption { - constructor(options: naver.maps.NaverImageMapTypeOptions); - static getBicycleLayer(opts: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; - static getBlankMap(opts: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; - static getCadastralLayer(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; - static getHybridMap(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; - static getMapTypes(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.MapTypeRegistry; - static getNormalLabelLayer(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; - static getNormalMap(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; - static getSatelliteLabelLayer(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; - static getSatelliteMap(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; - static getStreetLayer(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; - static getTerrainMap(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; - static getTrafficLayer(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; - static getVectorMap(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; - static getWorldMap(opts?: naver.maps.NaverImageMapTypeOptions): naver.maps.ImageMapType; + function NaverMapTypeOption(options: NaverImageMapTypeOptions): void; + namespace NaverMapTypeOption { + function getBicycleLayer(opts: NaverImageMapTypeOptions): ImageMapType; + function getBlankMap(opts: NaverImageMapTypeOptions): ImageMapType; + function getCadastralLayer(opts?: NaverImageMapTypeOptions): ImageMapType; + function getHybridMap(opts?: NaverImageMapTypeOptions): ImageMapType; + function getMapTypes(opts?: NaverImageMapTypeOptions): MapTypeRegistry; + function getNormalLabelLayer(opts?: NaverImageMapTypeOptions): ImageMapType; + function getNormalMap(opts?: NaverImageMapTypeOptions): ImageMapType; + function getSatelliteLabelLayer(opts?: NaverImageMapTypeOptions): ImageMapType; + function getSatelliteMap(opts?: NaverImageMapTypeOptions): ImageMapType; + function getStreetLayer(opts?: NaverImageMapTypeOptions): ImageMapType; + function getTerrainMap(opts?: NaverImageMapTypeOptions): ImageMapType; + function getTrafficLayer(opts?: NaverImageMapTypeOptions): ImageMapType; + function getVectorMap(opts?: NaverImageMapTypeOptions): ImageMapType; + function getWorldMap(opts?: NaverImageMapTypeOptions): ImageMapType; } + // Control - export class CustomControl extends naver.maps.KVO { - constructor(html: string, ControlOptions: naver.maps.ControlOptions); + class CustomControl extends KVO { + constructor(html: string, ControlOptions: ControlOptions); getElement(): HTMLElement; - getMap(): naver.maps.Map | null; + getMap(): Map | null; getOptions(key?: string): any; html(html?: string): string | undefined; - setMap(map?: naver.maps.Map | null): void; - setOptions(newOptions: naver.maps.ControlOptions): void; - setPosition(position: naver.maps.Position): void; + setMap(map?: Map | null): void; + setOptions(newOptions: ControlOptions): void; + setPosition(position: Position): void; } // Naver Controls - export class LogoControl extends naver.maps.CustomControl { - constructor(LogoControlOptions: naver.maps.LogoControlOptions); + class LogoControl extends CustomControl { + constructor(LogoControlOptions: LogoControlOptions); } - export class MapDataControl extends naver.maps.CustomControl { - constructor(MapDataControlOptions); + class MapDataControl extends CustomControl { + constructor(MapDataControlOptions: MapDataControlOptions); } - export class MapTypeControl extends naver.maps.CustomControl { - constructor(MapTypeControlOptions: naver.maps.MapTypeControlOptions); + class MapTypeControl extends CustomControl { + constructor(MapTypeControlOptions: MapTypeControlOptions); } - export class ScaleControl extends naver.maps.CustomControl { - constructor(ScaleControlOptions: naver.maps.ScaleControlOptions); + class ScaleControl extends CustomControl { + constructor(ScaleControlOptions: ScaleControlOptions); } - export class ZoomControl extends naver.maps.CustomControl { - constructor(ZoomControlOptions); + class ZoomControl extends CustomControl { + constructor(ZoomControlOptions: ZoomControlOptions); } // Layer - export class Layer extends naver.maps.KVO { - constructor(name: string, MapTypeRegistry: naver.maps.MapTypeRegistry, options: naver.maps.LayerOptions); - getLayerType(): naver.maps.MapType; + class Layer extends KVO { + constructor(name: string, MapTypeRegistry: MapTypeRegistry, options: LayerOptions); + getLayerType(): MapType; getLayerTypeId(): string; - getMap(): naver.maps.Map | null; + getMap(): Map | null; getOpacity(): number; getPaneElement(): HTMLElement; refresh(noEffect?: boolean): void; setLayerTypeId(typeId: string): void; - setMap(map: naver.maps.Map | null): void; + setMap(map: Map | null): void; setOpacity(opacity: number): void; } // Naver Layers - export class LabelLayer extends naver.maps.Layer { - constructor(name: string, registry: naver.maps.ImageMapType, option: object); + class LabelLayer extends Layer { + constructor(name: string, registry: ImageMapType, option: any); } - export class CadastralLayer extends naver.maps.LabelLayer { + class CadastralLayer extends LabelLayer { name: string; - constructor(option?: naver.maps.CadastralLayerOptions); + constructor(option?: CadastralLayerOptions); } - export class StreetLayer extends naver.maps.LabelLayer { + class StreetLayer extends LabelLayer { name: string; - constructor(option?: naver.maps.StreetLayerOptions); + constructor(option?: StreetLayerOptions); } - export class TrafficLayer extends naver.maps.LabelLayer { + class TrafficLayer extends LabelLayer { name: string; - constructor(option?: naver.maps.TrafficLayerOptions); + constructor(option?: TrafficLayerOptions); endAutoRefresh(): void; startAutoRefresh(): void; } // Data Layer - export class Data extends naver.maps.KVO { + class Data extends KVO { constructor(); - addFeature(feature: naver.maps.Feature, autoStyle: boolean): void; - addGeoJson(geojson: naver.maps.GeoJSON, autoStyle: boolean): void; - addGpx(xmlDoc: naver.maps.GPX, autoStyle: boolean): void; - addKml(xmlDoc: naver.maps.KML, autoStyle: boolean): void; - forEach(callback: (feature: naver.maps.Feature, index: number) => void): void; - getAllFeature(): naver.maps.Feature[]; - getFeatureById(id: string | number): naver.maps.Feature; - getMap(): naver.maps.Map | null; - getStyle(): naver.maps.StyleOptions | naver.maps.StylingFunction; - overrideStyle(feature: naver.maps.Feature, style: naver.maps.StyleOptions): void; - removeFeature(feature: naver.maps.Feature): void; - removeGeoJson(geojson: naver.maps.GeoJSON): void; - revertStyle(feature: naver.maps.Feature): void; - setMap(map: naver.maps.Map | null): void; - setStyle(style: naver.maps.StyleOptions | naver.maps.StylingFunction): void; - toGeoJson(): naver.maps.GeoJSON; + addFeature(feature: Feature, autoStyle: boolean): void; + addGeoJson(geojson: GeoJSON, autoStyle: boolean): void; + addGpx(xmlDoc: GPX, autoStyle: boolean): void; + addKml(xmlDoc: KML, autoStyle: boolean): void; + forEach(callback: (feature: Feature, index: number) => void): void; + getAllFeature(): Feature[]; + getFeatureById(id: string | number): Feature; + getMap(): Map | null; + getStyle(): StyleOptions | StylingFunction; + overrideStyle(feature: Feature, style: StyleOptions): void; + removeFeature(feature: Feature): void; + removeGeoJson(geojson: GeoJSON): void; + revertStyle(feature: Feature): void; + setMap(map: Map | null): void; + setStyle(style: StyleOptions | StylingFunction): void; + toGeoJson(): GeoJSON; } - export class Feature extends naver.maps.KVO { - constructor(rawFeature: object); - forEachOverlay(callback: naver.maps.forEachOverlayCallback): void; - getBounds(): naver.maps.Bounds; - getGeometries(): naver.maps.Geometry[]; + class Feature extends KVO { + constructor(rawFeature: any); + forEachOverlay(callback: forEachOverlayCallback): void; + getBounds(): Bounds; + getGeometries(): Geometry[]; getId(): string; - getOverlays(): naver.maps.Marker[] | naver.maps.Polyline[] | naver.maps.Polygon[]; + getOverlays(): Marker[] | Polyline[] | Polygon[]; getProperty(name: string): any; - getRaw(): naver.maps.GeoJSON; + getRaw(): GeoJSON; setProperty(name: string, value: any): void; - setStyle(styleOptions: naver.maps.StyleOptions); // naver.maps.Data.StyleOptions + setStyle(styleOptions: StyleOptions): void; // Data.StyleOptions } - export class Geometry extends naver.maps.KVO { - constructor(rawGeometry: object); - getCoords(): naver.maps.ArrayOfCoords; + class Geometry extends KVO { + constructor(rawGeometry: any); + getCoords(): ArrayOfCoords; getType(): string; } // Overlay - export abstract class OverlayView extends naver.maps.KVO { + class OverlayView extends KVO { draw(): void; - getContainerTopLeft(): naver.maps.Point; - getMap(): naver.maps.Map | null; - getPanes(): naver.maps.MapPanes; - getProjection(): naver.maps.MapSystemProjection; - abstract onAdd(): any; - abstract onRemove(): any; - setMap(map: naver.maps.Map | null): void; + getContainerTopLeft(): Point; + getMap(): Map | null; + getPanes(): MapPanes; + getProjection(): MapSystemProjection; + onAdd(): any; + onRemove(): any; + setMap(map: Map | null): void; } // Naver Overlays - export abstract class Circle extends naver.maps.OverlayView { - constructor(options?: naver.maps.CircleOptions); + class Circle extends OverlayView { + constructor(options?: CircleOptions); getAreaSize(): number; - getBounds(): naver.maps.Bounds; - getCenter(): naver.maps.Coord; + getBounds(): Bounds; + getCenter(): Coord; getClickable(): boolean; - getDrawingRect(): naver.maps.Bounds; - getOptions(key?: string): naver.maps.CircleOptions | any; + getDrawingRect(): Bounds; + getOptions(key?: string): CircleOptions; getRadius(): number; - getStyles(key: string): naver.maps.CircleOptions | any; + getStyles(key: string): CircleOptions; getVisible(): boolean; getZIndex(): number; - setCenter(center): naver.maps.Coord | naver.maps.CoordLiteral; + setCenter(center: Coord | CoordLiteral): void; setClickable(clickable: boolean): void; setOptions(key: string, value: any): void; - setOptions(options: naver.maps.CircleOptions): void; + setOptions(options: CircleOptions): void; setRadius(radius: number): void; setStyles(key: string, value: string): void; - setStyles(options: naver.maps.CircleOptions): void; + setStyles(options: CircleOptions): void; setVisible(visible: boolean): void; setZIndex(zIndex: number): void; } - export abstract class Ellipse extends naver.maps.OverlayView { - constructor(); + class Ellipse extends OverlayView { + constructor(options?: EllipseOptions); getAreaSize(): number; - getBounds(): naver.maps.Bounds; + getBounds(): Bounds; getClickable(): boolean; - getDrawingRect(): naver.maps.Bounds; - getOptions(key?: string): naver.maps.EllipseOptions | any; - getStyles(key?: string): naver.maps.EllipseOptions | any; + getDrawingRect(): Bounds; + getOptions(key?: string): EllipseOptions; + getStyles(key?: string): EllipseOptions; getVisible(): boolean; getZIndex(): number; - setBounds(bounds: naver.maps.Bounds | naver.maps.BoundsLiteral): void; - setOptions(options: naver.maps.EllipseOptions): void; + setBounds(bounds: Bounds | BoundsLiteral): void; + setOptions(options: EllipseOptions): void; setOptions(key: string, value: any): void; - setStyles(options: naver.maps.EllipseOptions): void; + setStyles(options: EllipseOptions): void; setStyles(key: string, value: any): void; setVisible(visible: boolean): void; setZIndex(zIndex: number): void; } - export abstract class GroundOverlay extends naver.maps.OverlayView { - constructor(url: string, bounds: naver.maps.Bounds | naver.maps.BoundsLiteral, options?: naver.maps.GroundOverlayOptions); - getBounds(): naver.maps.Bounds; + class GroundOverlay extends OverlayView { + constructor(url: string, bounds: Bounds | BoundsLiteral, options?: GroundOverlayOptions); + getBounds(): Bounds; getOpacity(): number; getUrl(): string; setOpacity(opacity: number): void; } - export abstract class InfoWindow extends naver.maps.OverlayView { - constructor(options: naver.maps.InfoWindowOptions); + class InfoWindow extends OverlayView { + constructor(options: InfoWindowOptions); close(): void; getContent(): HTMLElement; - getOptions(key?: string): naver.maps.InfoWindowOptions; - getPosition(): naver.maps.Coord; + getOptions(key?: string): InfoWindowOptions; + getPosition(): Coord; getZIndex(): number; - open(map: naver.maps.Map, anchor: naver.maps.Coord | naver.maps.CoordLiteral | naver.maps.Marker ): void; + open(map: Map, anchor: Coord | CoordLiteral | Marker): void; setContent(content: string | HTMLElement): void; - setOptions(options: naver.maps.InfoWindowOptions): void; - setPosition(position: naver.maps.Coord | naver.maps.CoordLiteral): void; + setOptions(options: InfoWindowOptions): void; + setPosition(position: Coord | CoordLiteral): void; setZIndex(zIndex: number): void; } - export abstract class Marker extends naver.maps.OverlayView { + class Marker extends OverlayView { constructor(options: MarkerOptions); - abstract draw(): void; - getAnimation(): naver.maps.Animation; + draw(): void; + getAnimation(): Animation; getClickable(): boolean; getCursor(): string; getDraggable(): boolean; - getDrawingRect(): naver.maps.Bounds; - getIcon(): naver.maps.ImageIcon | naver.maps.SymbolIcon | naver.maps.HtmlIcon; - getOptions(key?: string): naver.maps.MarkerOptions; - getPosition(): naver.maps.Coord; - getShape(): naver.maps.MarkerShape; + getDrawingRect(): Bounds; + getIcon(): ImageIcon | SymbolIcon | HtmlIcon; + getOptions(key?: string): MarkerOptions; + getPosition(): Coord; + getShape(): MarkerShape; getTitle(): string; getVisible(): boolean; getZIndex(): number; - abstract onAdd(): void; - abstract onRemove(): void; - setAnimation(animation: naver.maps.Animation): void; + onAdd(): void; + onRemove(): void; + setAnimation(animation: Animation): void; setClickable(clickable: boolean): void; setCursor(cursor: string): void; setDraggable(draggable: boolean): void; - setIcon(icon: string | naver.maps.ImageIcon | naver.maps.SymbolIcon | naver.maps.HtmlIcon): void; - setOptions(options: naver.maps.MarkerOptions): void; - setPosition(position: naver.maps.Coord | naver.maps.CoordLiteral): void; - setShape(shape: naver.maps.MarkerShape): void; + setIcon(icon: string | ImageIcon | SymbolIcon | HtmlIcon): void; + setOptions(options: MarkerOptions): void; + setPosition(position: Coord | CoordLiteral): void; + setShape(shape: MarkerShape): void; setTitle(title: string): void; setVisible(visible: boolean): void; setZIndex(zIndex: number): void; } - export abstract class Polygon extends naver.maps.OverlayView { - constructor(options?: naver.maps.PolygonOptions); + class Polygon extends OverlayView { + constructor(options?: PolygonOptions); getAreaSize(): number; - getBounds(): naver.maps.Bounds; + getBounds(): Bounds; getClickable(): boolean; - getDrawingRect(): naver.maps.Bounds; - getOptions(key?: string): naver.maps.PolygonOptions | any; - getPath(): naver.maps.ArrayOfCoords | naver.maps.KVOArrayOfCoords; + getDrawingRect(): Bounds; + getOptions(key?: string): PolygonOptions; + getPath(): ArrayOfCoords | KVOArrayOfCoords; getPaths(): ArrayOfCoords[] | KVOArrayOfCoords[]; - getStyles(key?: string): naver.maps.PolygonOptions | any; + getStyles(key?: string): PolygonOptions; getVisible(): boolean; getZIndex(): number; setClickable(clickable: boolean): void; setOptions(key: string, value: any): void; - setOptions(options: naver.maps.PolygonOptions): void; - setPath(path: naver.maps.ArrayOfCoords | naver.maps.KVOArrayOfCoords | naver.maps.ArrayOfCoordsLiteral): void; - setPaths(paths: naver.maps.ArrayOfCoords[] | naver.maps.ArrayOfCoordsLiteral | any): void; // TODO. KVOArray. + setOptions(options: PolygonOptions): void; + setPath(path: ArrayOfCoords | KVOArrayOfCoords | ArrayOfCoordsLiteral): void; + setPaths(paths: ArrayOfCoords[] | ArrayOfCoordsLiteral): void; // TODO. KVOArray. setStyles(key: string, value: any): void; - setStyles(options: naver.maps.PolygonOptions): void; + setStyles(options: PolygonOptions): void; setVisible(visible: boolean): void; setZIndex(zIndex: number): void; } - export abstract class Polyline extends naver.maps.OverlayView { - constructor(options?: naver.maps.PolylineOptions); - getBounds(): naver.maps.Bounds; + class Polyline extends OverlayView { + constructor(options?: PolylineOptions); + getBounds(): Bounds; getClickable(): boolean; getDistance(): number; - getDrawingRect(): naver.maps.Bounds; - getOptions(key?: string): naver.maps.PolylineOptions | any; - getPath(): naver.maps.ArrayOfCoords | naver.maps.KVOArrayOfCoords; - getStyles(key?: string): naver.maps.PolylineOptions | any; + getDrawingRect(): Bounds; + getOptions(key?: string): PolylineOptions; + getPath(): ArrayOfCoords | KVOArrayOfCoords; + getStyles(key?: string): PolylineOptions; getVisible(): boolean; getZIndex(): number; setClickable(clickable: boolean): void; setOptions(key: string, value: any): void; - setOptions(options: naver.maps.PolylineOptions): void; - setPath(path: naver.maps.ArrayOfCoords | naver.maps.KVOArrayOfCoords | naver.maps.ArrayOfCoordsLiteral): void; + setOptions(options: PolylineOptions): void; + setPath(path: ArrayOfCoords | KVOArrayOfCoords | ArrayOfCoordsLiteral): void; setStyles(key: string, value: any): void; - setStyles(options: naver.maps.PolylineOptions): void; + setStyles(options: PolylineOptions): void; setVisible(visible: boolean): void; setZIndex(zIndex: number): void; } - export abstract class Rectangle extends naver.maps.OverlayView { - constructor(options?: naver.maps.RectangleOptions); + class Rectangle extends OverlayView { + constructor(options?: RectangleOptions); getAreaSize(): number; - getBounds(): naver.maps.Bounds; + getBounds(): Bounds; getClickable(): boolean; - getDrawingRect(): naver.maps.Bounds; - getOptions(key?: string): naver.maps.RectangleOptions | any; - getStyles(key?: string): naver.maps.RectangleOptions | any; + getDrawingRect(): Bounds; + getOptions(key?: string): RectangleOptions; + getStyles(key?: string): RectangleOptions; getVisible(): boolean; getZIndex(): number; - setBounds(bounds: naver.maps.Bounds | naver.maps.BoundsLiteral): void; + setBounds(bounds: Bounds | BoundsLiteral): void; setClickable(clickable: boolean): void; - setOptions(options: naver.maps.RectangleOptions): void; + setOptions(options: RectangleOptions): void; setOptions(key: string, value: any): void; setStyles(key: string, value: any): void; - setStyles(options: naver.maps.RectangleOptions): void; + setStyles(options: RectangleOptions): void; setVisible(visible: boolean): void; setZIndex(zIndex: number): void; } // Sub module: panorama - export class PanoramaProjection extends naver.maps.KVO { - fromCoordToPov(coord: naver.maps.LatLng): naver.maps.PanoramaPov; + class PanoramaProjection extends KVO { + fromCoordToPov(coord: LatLng): PanoramaPov; } - export class Panorama extends naver.maps.KVO { - constructor(panoramaDiv: string | HTMLElement, panoramaOptions: naver.maps.PanoramaOptions); - getLocation(): naver.maps.PanoramaLocation; + class Panorama extends KVO { + constructor(panoramaDiv: string | HTMLElement, panoramaOptions: PanoramaOptions); + getLocation(): PanoramaLocation; getMaxScale(): number; getMaxZoom(): number; getMinScale(): number; getMinZoom(): number; getPanoId(): string; - getPosition(): naver.maps.LatLng; - getPov(): naver.maps.PanoramaPov; - getProjection(): naver.maps.PanoramaProjection; + getPosition(): LatLng; + getPov(): PanoramaPov; + getProjection(): PanoramaProjection; getScale(): number; - getSize(): naver.maps.Size; + getSize(): Size; getVisible(): boolean; getZoom(): number; - setOptions(key: string, value: any); - setOptions(newOptions: naver.maps.PanoramaOptions | object); + setOptions(key: string, value: any): void; + setOptions(newOptions: PanoramaOptions): void; setPanoId(panoId: string): void; - setPanoIdWithPov(panoId: string, pov: naver.maps.PanoramaPov): void; - setPosition(position: naver.maps.LatLng | naver.maps.LatLngLiteral): void; - setPov(pov: naver.maps.PanoramaPov): void; + setPanoIdWithPov(panoId: string, pov: PanoramaPov): void; + setPosition(position: LatLng | LatLngLiteral): void; + setPov(pov: PanoramaPov): void; setScale(scale: number): void; - setSize(size: naver.maps.Size | naver.maps.SizeLiteral): void; + setSize(size: Size | SizeLiteral): void; setVisible(visible: boolean): void; setZoom(zoom: number): void; zoomIn(): void; zoomOut(): void; } - export class FlightSpot extends naver.maps.KVO { + class FlightSpot extends KVO { constructor(); - getMap(): naver.maps.Map | null; - setMap(map: naver.maps.Map | null): void; + getMap(): Map | null; + setMap(map: Map | null): void; } - export class AroundControl extends naver.maps.CustomControl { + class AroundControl extends CustomControl { constructor(aroundControlOptions: AroundControlOptions); } // Sub module: drawing - export module drawing { - export interface DrawingOptions { - map?: naver.maps.Map; - drawingControl?: naver.maps.drawing.DrawingMode[]; - drawingControlOptions?: naver.maps.drawing.drawingControlOptions; - drawingMode?: naver.maps.drawing.DrawingMode; - controlPointOptions?: naver.maps.drawing.controlPointOptions; - rectangleOptions?: naver.maps.RectangleOptions; - ellipseOptions?: naver.maps.EllipseOptions; - polylineOptions?: naver.maps.PolylineOptions; - arrowlineOptions?: naver.maps.PolylineOptions; - polygonOptions?: naver.maps.PolygonOptions; - markerOptions?: naver.maps.MarkerOptions; + namespace drawing { + interface DrawingOptions { + map?: Map; + drawingControl?: DrawingMode[]; + drawingControlOptions?: drawingControlOptions; + drawingMode?: DrawingMode; + controlPointOptions?: controlPointOptions; + rectangleOptions?: RectangleOptions; + ellipseOptions?: EllipseOptions; + polylineOptions?: PolylineOptions; + arrowlineOptions?: PolylineOptions; + polygonOptions?: PolygonOptions; + markerOptions?: MarkerOptions; } type drawingControlOptions = DrawingControlOptions; - export interface DrawingControlOptions { - position?: naver.maps.Position; - style?: naver.maps.drawing.DrawingStyle; + interface DrawingControlOptions { + position?: Position; + style?: DrawingStyle; } type controlPointOptions = ControlPointOptions; - export interface ControlPointOptions { - anchorPointOptions: naver.maps.CircleOptions; - midPointOptions: naver.maps.CircleOptions; + interface ControlPointOptions { + anchorPointOptions: CircleOptions; + midPointOptions: CircleOptions; } - export interface DrawingOverlay { + interface DrawingOverlay { id: string; name: string; - setEditable: (editable: boolean, controlPointOptions?: naver.maps.drawing.controlPointOptions) => void; + setEditable: (editable: boolean, controlPointOptions?: controlPointOptions) => void; } - export enum DrawingStyle { + enum DrawingStyle { HORIZONTAL = 0, VERTICAL, HORIZONTAL_2, VERTICAL_2 } - export enum DrawingMode { + enum DrawingMode { HAND = 0, RECTANGLE, ELLIPSE, @@ -1088,7 +1126,7 @@ declare namespace naver.maps { POLYGON, MARKER } - export enum DrawingEvent { + enum DrawingEvent { ADD, REMOVE, SELECT, @@ -1096,41 +1134,41 @@ declare namespace naver.maps { Removed, Selected } - export class DrawingManager extends naver.maps.KVO { - constructor(options?: naver.maps.drawing.DrawingOptions); - addDrawing(overlay: naver.maps.drawing.DrawingOverlay, drawingMode: naver.maps.drawing.DrawingMode, id?: string): void; - addListener(eventName: naver.maps.drawing.DrawingEvent, - listener: (overlay: naver.maps.drawing.DrawingOverlay) => void): naver.maps.MapEventListener; + class DrawingManager extends KVO { + constructor(options?: DrawingOptions); + addDrawing(overlay: DrawingOverlay, drawingMode: DrawingMode, id?: string): void; + addListener(eventName: DrawingEvent, + listener: (overlay: DrawingOverlay) => void): MapEventListener; destroy(): void; - getDrawing(id: string): naver.maps.drawing.DrawingOverlay; - getDrawings(): object; - getMap(): naver.maps.Map | null; - setMap(map: naver.maps.Map | null): void; - toGeoJson(): object; + getDrawing(id: string): DrawingOverlay; + getDrawings(): any; + getMap(): Map | null; + setMap(map: Map | null): void; + toGeoJson(): any; } } // Sub module: visualization - export module visualization { - export interface DotMapOptions { - map: naver.maps.Map; - data: naver.maps.LatLng[] | naver.maps.PointArrayLiteral[] | naver.maps.visualization.WeightedLocation[]; + namespace visualization { + interface DotMapOptions { + map: Map; + data: LatLng[] | PointArrayLiteral[] | WeightedLocation[]; opacity?: number; radius?: number; strokeWeight?: number; strokeColor?: string; - strokeLineCap?: naver.maps.strokeLineCapType; - strokeLineJoin?: naver.maps.strokeLineJoinType; + strokeLineCap?: strokeLineCapType; + strokeLineJoin?: strokeLineJoinType; fillColor?: string; } - export interface HeatMapOptions { - map: naver.maps.Map; - data: naver.maps.LatLng[] | naver.maps.PointArrayLiteral[] | naver.maps.visualization.WeightedLocation[]; + interface HeatMapOptions { + map: Map; + data: LatLng[] | PointArrayLiteral[] | WeightedLocation[]; opacity?: number; radius?: number; - colorMap?: naver.maps.visualization.SpectrumStyle; + colorMap?: SpectrumStyle; } - export enum SpectrumStyle { + enum SpectrumStyle { JET, HSV, HOT, @@ -1143,35 +1181,35 @@ declare namespace naver.maps { PORTLAND, OXYGEN } - export class DotMap extends naver.maps.KVO { - constructor(dotMapOptions?: naver.maps.visualization.DotMapOptions); - addDrawing(overlay: naver.maps.drawing.DrawingOverlay, drawingMode: naver.maps.drawing.DrawingMode, id?: string): void; - addListener(eventName: naver.maps.drawing.DrawingEvent, - listener: (overlay: naver.maps.drawing.DrawingOverlay) => void): naver.maps.MapEventListener; + class DotMap extends KVO { + constructor(dotMapOptions?: DotMapOptions); + addDrawing(overlay: drawing.DrawingOverlay, drawingMode: drawing.DrawingMode, id?: string): void; + addListener(eventName: drawing.DrawingEvent, + listener: (overlay: drawing.DrawingOverlay) => void): MapEventListener; destroy(): void; - getDrawing(id: string): naver.maps.drawing.DrawingOverlay; - getDrawings(): object; - getMap(): naver.maps.Map | null; - setMap(map: naver.maps.Map | null): void; - toGeoJson(): object; + getDrawing(id: string): drawing.DrawingOverlay; + getDrawings(): any; + getMap(): Map | null; + setMap(map: Map | null): void; + toGeoJson(): any; } - export class HeatMap { - constructor(heatMapOptions?: naver.maps.visualization.HeatMapOptions); - getColorMap(): naver.maps.visualization.SpectrumStyle; - getData(): naver.maps.LatLng[] | naver.maps.PointArrayLiteral[]; - getMap(): naver.maps.Map | null; - getOptions(key?: string): naver.maps.visualization.HeatMapOptions | any; + class HeatMap { + constructor(heatMapOptions?: HeatMapOptions); + getColorMap(): SpectrumStyle; + getData(): LatLng[] | PointArrayLiteral[]; + getMap(): Map | null; + getOptions(key?: string): HeatMapOptions; redraw(): void; - setColorMap(colormap: naver.maps.visualization.SpectrumStyle, inReverse: boolean): void; - setData(data: naver.maps.LatLng[] | naver.maps.PointArrayLiteral[]): void; - setMap(map: naver.maps.Map | null): void; + setColorMap(colormap: SpectrumStyle, inReverse: boolean): void; + setData(data: LatLng[] | PointArrayLiteral[]): void; + setMap(map: Map | null): void; setOptions(key: string, value: any): void; - setOptions(options: naver.maps.visualization.HeatMapOptions): void; + setOptions(options: HeatMapOptions): void; } - export class WeightedLocation { + class WeightedLocation { constructor(lat: number, lng: number, weight?: number); - clone(): naver.maps.visualization.WeightedLocation; - getLocation(): naver.maps.LatLng; + clone(): WeightedLocation; + getLocation(): LatLng; getWeight(): number; lat(): number; lng(): number; @@ -1180,18 +1218,18 @@ declare namespace naver.maps { } // Sub module: geocoder - export module Service { - export interface ServiceOptions { + namespace Service { + interface ServiceOptions { encoding?: any; coordType?: any; } - export interface GeocodeServiceOptions extends ServiceOptions { + interface GeocodeServiceOptions extends ServiceOptions { address?: string; } - export interface ReverseServiceOptions extends ServiceOptions { + interface ReverseServiceOptions extends ServiceOptions { location?: Coord | CoordLiteral; } - export interface AddressItem { + interface AddressItem { address: string; addrdetail: { country: string; @@ -1201,153 +1239,153 @@ declare namespace naver.maps { rest: string; }; } - export interface GeocodeResponse { + interface GeocodeResponse { result: { - userquery: object; + userquery: any; total: number; - items: naver.maps.Service.AddressItem[]; + items: AddressItem[]; }; } - export interface ReverseGeocodeResponse { + interface ReverseGeocodeResponse { result: { userquery: string; total: number; - items: naver.maps.Service.AddressItem[]; + items: AddressItem[]; }; } - export enum CoordType { - LATLNG = 'latlng', - TM128 = 'tm128' + enum CoordType { + LATLNG, + TM128 } - export enum Encoding { - UTF_8 = 'utf-8', - EUC_KR = 'euc-kr' + enum Encoding { + UTF_8, + EUC_KR } - export enum Status { - OK = 200, - ERROR = 500 + enum Status { + OK, + ERROR } - function fromAddrToCoord(); - function fromCoordToAddr(); - function geocode(options: naver.maps.Service.GeocodeServiceOptions, - callback?: (status: naver.maps.Service.Status, response: naver.maps.Service.GeocodeResponse) => void); - function reverseGeocode(options: naver.maps.Service.ReverseServiceOptions, - callback?: (status: naver.maps.Service.Status, response: naver.maps.Service.ReverseGeocodeResponse) => void); + function fromAddrToCoord(): void; + function fromCoordToAddr(): void; + function geocode(options: GeocodeServiceOptions, + callback?: (status: Status, response: GeocodeResponse) => void): void; + function reverseGeocode(options: ReverseServiceOptions, + callback?: (status: Status, response: ReverseGeocodeResponse) => void): void; } - export module TransCoord { - function fromEPSG3857ToLatLng(coord: naver.maps.Point): naver.maps.LatLng; - function fromEPSG3857ToNaver(coord: naver.maps.Point): naver.maps.Point; - function fromEPSG3857ToTM128(coord: naver.maps.Point): naver.maps.Point; - function fromEPSG3857ToUTMK(coord: naver.maps.Point): naver.maps.Point; - function fromLatLngToEPSG3857(latlng: naver.maps.Coord): naver.maps.Point; - function fromLatLngToNaver(latlng: naver.maps.Coord): naver.maps.Point; - function fromLatLngToTM128(latlng: naver.maps.Coord): naver.maps.Point; - function fromLatLngToUTMK(latlng: naver.maps.Coord): naver.maps.Point; - function fromNaverToEPSG3857(n: naver.maps.Point): naver.maps.Point; - function fromNaverToLatLng(n: naver.maps.Point): naver.maps.LatLng; - function fromNaverToTM128(n: naver.maps.Point): naver.maps.Point; - function fromNaverToUTMK(n: naver.maps.Point): naver.maps.Point; - function fromTM128ToEPSG3857(tm128: naver.maps.Point): naver.maps.Point; - function fromTM128ToLatLng(tm128: naver.maps.Point): naver.maps.LatLng; - function fromTM128ToNaver(tm128: naver.maps.Point): naver.maps.Point; - function fromTM128ToUTMK(tm128: naver.maps.Point): naver.maps.Point; - function fromUTMKToEPSG3857(utmk: naver.maps.Point): naver.maps.Point; - function fromUTMKToLatLng(utmk: naver.maps.Point): naver.maps.LatLng; - function fromUTMKToNaver(utmk: naver.maps.Point): naver.maps.Point; - function fromUTMKToTM128(utmk: naver.maps.Point): naver.maps.Point; + namespace TransCoord { + function fromEPSG3857ToLatLng(coord: Point): LatLng; + function fromEPSG3857ToNaver(coord: Point): Point; + function fromEPSG3857ToTM128(coord: Point): Point; + function fromEPSG3857ToUTMK(coord: Point): Point; + function fromLatLngToEPSG3857(latlng: Coord): Point; + function fromLatLngToNaver(latlng: Coord): Point; + function fromLatLngToTM128(latlng: Coord): Point; + function fromLatLngToUTMK(latlng: Coord): Point; + function fromNaverToEPSG3857(n: Point): Point; + function fromNaverToLatLng(n: Point): LatLng; + function fromNaverToTM128(n: Point): Point; + function fromNaverToUTMK(n: Point): Point; + function fromTM128ToEPSG3857(tm128: Point): Point; + function fromTM128ToLatLng(tm128: Point): LatLng; + function fromTM128ToNaver(tm128: Point): Point; + function fromTM128ToUTMK(tm128: Point): Point; + function fromUTMKToEPSG3857(utmk: Point): Point; + function fromUTMKToLatLng(utmk: Point): LatLng; + function fromUTMKToNaver(utmk: Point): Point; + function fromUTMKToTM128(utmk: Point): Point; } - export module Event { - function addDOMListener(element: HTMLElement, eventName: string, listener: Function): void; - function addListener(target: object, eventName: string, listener: Function): naver.maps.MapEventListener; - function clearInstanceListeners(target: object): void; - function clearListeners(target: object, fromEventName: string): void; - function forward(source: object, fromEventName: string, target: object, toEventName: string): naver.maps.MapEventListener; - function hasListener(target: object, eventName: string): boolean; - function once(target: object, eventName: string, listener: Function): naver.maps.MapEventListener; - function removeDOMListener(element: HTMLElement, eventName: string, listener: Function): void; - function removeDOMListener(listeners: naver.maps.DOMEventListener | naver.maps.DOMEventListener[]): void; - function removeListener(listeners: naver.maps.MapEventListener | naver.maps.MapEventListener[]): void; - function resumeDispatch(target: object, eventName: string): void; - function stopDispatch(target: object, eventName: string): void; - function trigger(target: object, eventName: string, eventObject?: any): void; + namespace Event { + function addDOMListener(element: HTMLElement, eventName: string, listener: () => any): void; + function addListener(target: any, eventName: string, listener: () => any): MapEventListener; + function clearInstanceListeners(target: any): void; + function clearListeners(target: any, fromEventName: string): void; + function forward(source: any, fromEventName: string, target: any, toEventName: string): MapEventListener; + function hasListener(target: any, eventName: string): boolean; + function once(target: any, eventName: string, listener: () => any): MapEventListener; + function removeDOMListener(element: HTMLElement, eventName: string, listener: () => any): void; + function removeDOMListener(listeners: DOMEventListener | DOMEventListener[]): void; + function removeListener(listeners: MapEventListener | MapEventListener[]): void; + function resumeDispatch(target: any, eventName: string): void; + function stopDispatch(target: any, eventName: string): void; + function trigger(target: any, eventName: string, eventObject?: any): void; } // Projection - export module EPSG3857 { // implements naver.maps.Projection - function fromCoordToPoint(coord: naver.maps.Coord): naver.maps.Point; - function fromLatLngToPoint(latlng: naver.maps.LatLng): naver.maps.Point; - function fromPointToCoord(point: naver.maps.Point): naver.maps.LatLng; - function fromPointToLatLng(point: naver.maps.Point): naver.maps.LatLng; - function getDestinationCoord(fromLatLng: naver.maps.LatLng, angle: number, meter: number): naver.maps.LatLng; - function getDistance(latlng1: naver.maps.LatLng, latlng2: naver.maps.LatLng): number; + namespace EPSG3857 { // implements Projection + function fromCoordToPoint(coord: Coord): Point; + function fromLatLngToPoint(latlng: LatLng): Point; + function fromPointToCoord(point: Point): LatLng; + function fromPointToLatLng(point: Point): LatLng; + function getDestinationCoord(fromLatLng: LatLng, angle: number, meter: number): LatLng; + function getDistance(latlng1: LatLng, latlng2: LatLng): number; } - export class UTMK { - name: string; - pointPerMeter: number; - static fromCoordToPoint(latlng: naver.maps.LatLng): naver.maps.Point; - static fromCoordToUTMK(latlng: naver.maps.LatLng): naver.maps.Point; - static fromLatLngToPoint(latlng: naver.maps.LatLng): naver.maps.Point; - static fromLatLngToUTMK(latlng: naver.maps.LatLng): naver.maps.Point; - static fromPointToCoord(point: naver.maps.Point): naver.maps.LatLng; - static fromPointToLatLng(point: naver.maps.Point): naver.maps.LatLng; - static fromPointToUTMK(point: naver.maps.Point): naver.maps.Point; - static fromUTMKToCoord(utmk: naver.maps.Point): naver.maps.LatLng; - static fromUTMKToLatLng(utmk: naver.maps.Point): naver.maps.LatLng; - static fromUTMKToPoint(utmk: naver.maps.Point): naver.maps.Point; - static getDestinationCoord(fromLatLng: naver.maps.LatLng, angle: number, meter: number): naver.maps.LatLng; - static getDistance(latlng1: naver.maps.LatLng, latlng2: naver.maps.LatLng): number; + namespace UTMK { + let name: string; + let pointPerMeter: number; + function fromCoordToPoint(latlng: LatLng): Point; + function fromCoordToUTMK(latlng: LatLng): Point; + function fromLatLngToPoint(latlng: LatLng): Point; + function fromLatLngToUTMK(latlng: LatLng): Point; + function fromPointToCoord(point: Point): LatLng; + function fromPointToLatLng(point: Point): LatLng; + function fromPointToUTMK(point: Point): Point; + function fromUTMKToCoord(utmk: Point): LatLng; + function fromUTMKToLatLng(utmk: Point): LatLng; + function fromUTMKToPoint(utmk: Point): Point; + function getDestinationCoord(fromLatLng: LatLng, angle: number, meter: number): LatLng; + function getDistance(latlng1: LatLng, latlng2: LatLng): number; } - export class UTMK_NAVER { // extends naver.maps.UTMK - name: string; - pointPerMeter: number; - static fromCoordToNaver(latlng: naver.maps.LatLng): naver.maps.Point; - static fromLatLngToNaver(latlng: naver.maps.LatLng): naver.maps.Point; - static fromNaverToCoord(naverPoint: naver.maps.Point): naver.maps.LatLng; - static fromNaverToLatLng(naverPoint: naver.maps.Point): naver.maps.LatLng; - static fromNaverToPoint(naverPoint: naver.maps.Point): naver.maps.Point; - static fromNaverToUTMK(naverPoint: naver.maps.Point): naver.maps.Point; - static fromPointToNaver(point: naver.maps.Point): naver.maps.Point; - static fromUTMKToNaver(utmk: naver.maps.Point): naver.maps.Point; + namespace UTMK_NAVER { // extends UTMK + let name: string; + let pointPerMeter: number; + function fromCoordToNaver(latlng: LatLng): Point; + function fromLatLngToNaver(latlng: LatLng): Point; + function fromNaverToCoord(naverPoint: Point): LatLng; + function fromNaverToLatLng(naverPoint: Point): LatLng; + function fromNaverToPoint(naverPoint: Point): Point; + function fromNaverToUTMK(naverPoint: Point): Point; + function fromPointToNaver(point: Point): Point; + function fromUTMKToNaver(utmk: Point): Point; } - export class EPSG3857Coord { - static fromCoordToLatLng(coord: naver.maps.Point): naver.maps.LatLng; - static fromCoordToPoint(coord: naver.maps.Point): naver.maps.Point; - static fromEPSG3857ToLatLng(coord: naver.maps.Point): naver.maps.LatLng; - static fromEPSG3857ToPoint(coord: naver.maps.Point): naver.maps.Point; - static fromLatLngToCoord(coord: naver.maps.Coord): naver.maps.Point; - static fromLatLngToEPSG3857(coord: naver.maps.Coord): naver.maps.Point; - static fromPointToCoord(point: naver.maps.Point): naver.maps.Point; - static fromPointToEPSG3857(point: naver.maps.Point): naver.maps.Point; + namespace EPSG3857Coord { + function fromCoordToLatLng(coord: Point): LatLng; + function fromCoordToPoint(coord: Point): Point; + function fromEPSG3857ToLatLng(coord: Point): LatLng; + function fromEPSG3857ToPoint(coord: Point): Point; + function fromLatLngToCoord(coord: Coord): Point; + function fromLatLngToEPSG3857(coord: Coord): Point; + function fromPointToCoord(point: Point): Point; + function fromPointToEPSG3857(point: Point): Point; } - export class TM128 { // extends naver.maps.TM128Coord - static fromCoordToPoint(latlng: naver.maps.Coord): naver.maps.Point; - static fromPointToCoord(point: naver.maps.Point): naver.maps.LatLng; + namespace TM128 { // extends TM128Coord + function fromCoordToPoint(latlng: Coord): Point; + function fromPointToCoord(point: Point): LatLng; } - export class TM128Coord { // extends naver.maps.UTMK - static fromCoordToLatLng(tm128: naver.maps.Point): naver.maps.LatLng; - static fromCoordToPoint(tm128: naver.maps.Point): naver.maps.Point; - static fromLatLngToCoord(latlng: naver.maps.Coord): naver.maps.Point; - static fromLatLngToTM128(latlng: naver.maps.Coord): naver.maps.Point; - static fromPointToCoord(point: naver.maps.Point): naver.maps.Point; - static fromPointToTM128(point: naver.maps.Point): naver.maps.Point; - static fromTM128ToLatLng(tm128: naver.maps.Point): naver.maps.LatLng; - static fromTM128ToPoint(tm128: naver.maps.Point): naver.maps.Point; - static fromTM128ToUTMK(tm128: naver.maps.Point): naver.maps.Point; - static fromUTMKToTM128(utmk: naver.maps.Point): naver.maps.Point; + namespace TM128Coord { // extends UTMK + function fromCoordToLatLng(tm128: Point): LatLng; + function fromCoordToPoint(tm128: Point): Point; + function fromLatLngToCoord(latlng: Coord): Point; + function fromLatLngToTM128(latlng: Coord): Point; + function fromPointToCoord(point: Point): Point; + function fromPointToTM128(point: Point): Point; + function fromTM128ToLatLng(tm128: Point): LatLng; + function fromTM128ToPoint(tm128: Point): Point; + function fromTM128ToUTMK(tm128: Point): Point; + function fromUTMKToTM128(utmk: Point): Point; } - export class UTMK_NAVERCoord { // extends naver.maps.UTMK_NAVER - static fromCoordToLatLng(n: naver.maps.Point): naver.maps.LatLng; - static fromCoordToPoint(n: naver.maps.Point): naver.maps.Point; - static fromLatLngToCoord(latlng: naver.maps.Coord): naver.maps.Point; - static fromPointToCoord(point: naver.maps.Point): naver.maps.Point; + namespace UTMK_NAVERCoord { // extends UTMK_NAVER + function fromCoordToLatLng(n: Point): LatLng; + function fromCoordToPoint(n: Point): Point; + function fromLatLngToCoord(latlng: Coord): Point; + function fromPointToCoord(point: Point): Point; } - export class UTMKCoord { // extends naver.maps.UTMK - static fromCoordToLatLng(utmk: naver.maps.Point): naver.maps.LatLng; - static fromCoordToPoint(utmk: naver.maps.Point): naver.maps.Point; - static fromLatLngToCoord(latlng: naver.maps.Coord): naver.maps.Point; - static fromPointToCoord(point: naver.maps.Point): naver.maps.Point; + namespace UTMKCoord { // extends UTMK + function fromCoordToLatLng(utmk: Point): LatLng; + function fromCoordToPoint(utmk: Point): Point; + function fromLatLngToCoord(latlng: Coord): Point; + function fromPointToCoord(point: Point): Point; } } diff --git a/types/navermaps/navermaps-tests.ts b/types/navermaps/navermaps-tests.ts index a3e84e94a2..81bbe620f5 100644 --- a/types/navermaps/navermaps-tests.ts +++ b/types/navermaps/navermaps-tests.ts @@ -1,13 +1,12 @@ -var map = new naver.maps.Map('map'); +let map = new naver.maps.Map('map'); map.setMapTypeId(naver.maps.MapTypeId.HYBRID); - -var jeju = new naver.maps.LatLng(33.3590628, 126.534361); +const jeju = new naver.maps.LatLng(33.3590628, 126.534361); map.setCenter(jeju); // 중심 좌표 이동 map.setZoom(13); // 줌 레벨 변경 -var seoul = new naver.maps.LatLngBounds( +const seoul = new naver.maps.LatLngBounds( new naver.maps.LatLng(37.42829747263545, 126.76620435615891), new naver.maps.LatLng(37.7010174173061, 127.18379493229875)); @@ -15,13 +14,13 @@ map.fitBounds(seoul); // 좌표 경계 이동 map.panBy(new naver.maps.Point(10, 10)); // 우측 하단으로 10 픽셀 이동 -var map = new naver.maps.Map('map', { +map = new naver.maps.Map('map', { mapTypeId: naver.maps.MapTypeId.HYBRID }); -var registry = new naver.maps.MapTypeRegistry(); +const registry = new naver.maps.MapTypeRegistry(); -var map = new naver.maps.Map('map', { +map = new naver.maps.Map('map', { mapTypes: registry, mapTypeId: naver.maps.MapTypeId.SATELLITE }); @@ -31,118 +30,122 @@ map.mapTypes.set(naver.maps.MapTypeId.HYBRID, naver.maps.NaverMapTypeOption.getH map.setMapTypeId(naver.maps.MapTypeId.NORMAL); // error thrown -var MyMapType = { - name: "Alphabet", +const GTA5MapTypeOption1 = { minZoom: 0, maxZoom: 22, projection: naver.maps.EPSG3857, - tileSize: new naver.maps.Size(50, 50), - getTile: function(x, y, z) { - var w = this.tileSize.width, - h = this.tileSize.height; - - var ascii = parseInt(Math.abs(x + y) % 26, 10) + 65; - alphabet = String.fromCharCode(ascii); - var tile = document.createElement('div'); - - tile.style.width = w +'px'; - tile.style.height = w +'px'; - - return tile; - } -}; - -var map = new naver.maps.Map('map', { - center: new naver.maps.LatLng(37.3595704, 127.105399), - zoom: 10, - mapTypeId: 'mine', - mapTypes: new naver.maps.MapTypeRegistry({ - 'mine': MyMapType - }), - mapTypeControl: true, - mapTypeControlOptions: { - style: naver.maps.MapTypeControlStyle.DROPDOWN - } -}); - -var GTA5MapTypeOption = function(name, type) { - this.name = name; - this.type = type; -}; -GTA5MapTypeOption.prototype = { - constructor: GTA5MapTypeOption, - - name: '', - type: '', - projection: naver.maps.EPSG3857, - minZoom: 1, - maxZoom: 6, + name: '세계 지도', tileSize: new naver.maps.Size(256, 256), - TRANSPARENT_URL: 'http://static.naver.net/maps/dot.gif', - tileRanges: [1, 2, 4, 8, 16, 32], - - getName: function() { - return this.name; - }, - - getTileUrl: function(x, y, z) { - var tileRange = this.tileRanges[z - 1]; - - if ((x >=0 && x < tileRange) && (y >=0 && y < tileRange)) { - return "http://gta-5-map.com/" +this.type+'/'+z+'-'+x+'_'+y+".png"; - } else { - return this.TRANSPARENT_URL; - } - }, - - onerror: function(tileImg) { - tileImg.src = this.TRANSPARENT_URL; - } + repeatX: true, + vendor: 'MyCorp.', + provider: [{ + title: "내 지도 ver 1.0" + }, { + title: "OpenStreetMap", + link: "http://www.openstreetmap.org/copyright" + }, { + title: "/인천광역시", + bounds: new naver.maps.LatLngBounds( + new naver.maps.LatLng(36.915887, 125.690716), + new naver.maps.LatLng(37.687529, 126.853252)) + }], + tileSet: [ + "http://mymap1.com/tiles/world/{z}/{x}/{y}.png", + "http://mymap2.com/tiles/world/{z}/{x}/{y}.png", + "http://mymap3.com/tiles/world/{z}/{x}/{y}.png", + "http://mymap4.com/tiles/world/{z}/{x}/{y}.png" + ] }; -var map = new naver.maps.Map('map', { +map = new naver.maps.Map('map', { center: new naver.maps.LatLng(74.92514151088395, -127.880859375), zoom: 2, mapTypes: new naver.maps.MapTypeRegistry({ - "Atlas": new naver.maps.ImageMapType(new GTA5MapTypeOption("Atlas", "Tiles_ATLAS")), - "Satellite": new naver.maps.ImageMapType(new GTA5MapTypeOption("Satellite", "Tiles_SAT")), + Atlas: new naver.maps.ImageMapType(GTA5MapTypeOption1) }) }); map.setMapTypeId("Atlas"); -var MyMapType = { - name: "Alphabet", - minZoom: 0, - maxZoom: 22, - tileSize: new naver.maps.Size(50, 50), - getTileData: function(x, y, z) { - var w = this.tileSize.width, - h = this.tileSize.height, - canvas = document.createElement("canvas"), - ctx = canvas.getContext("2d"); +const map2 = new naver.maps.Map('map', { + center: new naver.maps.LatLng(37.3595704, 127.105399), + zoom: 10 +}); - var ascii = parseInt(Math.abs(x + y) % 26, 10) + 65; - alphabet = String.fromCharCode(ascii); +const marker = new naver.maps.Marker({ + position: new naver.maps.LatLng(37.3595704, 127.105399), + map: map2 +}); - canvas.width = w; - canvas.height = h; +const HOME_PATH = ''; - ctx.globalAlpha = 1 - ((ascii - 65) * 0.04); +const cityhall = new naver.maps.LatLng(37.5666805, 126.9784147); +const map3 = new naver.maps.Map('map', { + center: cityhall.destinationPoint(0, 500), + zoom: 10 +}); +const marker2 = new naver.maps.Marker({ + map: map3, + position: cityhall +}); - ctx.rect(0, 0, w, h); - ctx.fillStyle = "#000"; - ctx.fill(); - ctx.lineWidth = 1; - ctx.strokeStyle = "#aaa"; - ctx.stroke(); +const contentString = [ + `
+

서울특별시청

+

서울특별시 중구 태평로1가 31 | 서울특별시 중구 세종대로 110 서울특별시청
+ 서울시청
+ 02-120 | 공공,사회기관 > 특별,광역시청
+ www.seoul.go.kr/ +

+
` + ].join(''); - ctx.font = "bold " + (Math.min(w, h) - 10) + "px Arial"; - ctx.textBaseline = "middle"; - ctx.textAlign = "center"; - ctx.fillStyle = "#fff"; - ctx.fillText(alphabet, w / 2, h / 2); +const infowindow = new naver.maps.InfoWindow({ + content: contentString +}); - return ctx.getImageData(0, 0, w, h); +naver.maps.Event.addListener(marker2, "click", () => { + if (infowindow.getMap()) { + infowindow.close(); + } else { + infowindow.open(map3, marker2); } -}; +}); + +infowindow.open(map3, marker2); + +const GREEN_FACTORY = new naver.maps.LatLng(37.3595953, 127.1053971); + +const map4 = new naver.maps.Map('map', { + center: GREEN_FACTORY, + zoom: 3 +}); + +const rectangle = new naver.maps.Rectangle({ + map: map4, + bounds: new naver.maps.LatLngBounds( + new naver.maps.LatLng(37.1793196, 125.8795594), + new naver.maps.LatLng(37.5398662, 126.3312422) + ) +}); + +const circle = new naver.maps.Circle({ + map: map4, + center: GREEN_FACTORY, + radius: 20000, + fillColor: 'crimson', + fillOpacity: 0.8 +}); + +const ellipse = new naver.maps.Ellipse({ + map: map4, + bounds: new naver.maps.LatLngBounds( + new naver.maps.LatLng(37.1793196, 127.6795594), + new naver.maps.LatLng(37.5398662, 128.4312422) + ), + strokeColor: 'yellowgreen', + strokeOpacity: 1, + strokeWeight: 3, + fillColor: 'yellowgreen', + fillOpacity: 0.3 +});