diff --git a/types/leaflet.locatecontrol/index.d.ts b/types/leaflet.locatecontrol/index.d.ts index 3f4d94e9ce..7692c2bb60 100644 --- a/types/leaflet.locatecontrol/index.d.ts +++ b/types/leaflet.locatecontrol/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Leaflet.locate 0.60 +// Type definitions for leaflet.locatecontrol 0.60 // Project: https://github.com/domoritz/leaflet-locatecontrol // Definitions by: Denis Carriere // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -7,39 +7,37 @@ declare namespace L { namespace Control { - export interface Locate extends L.Control {} - export interface LocateOptions { - position?: string - layer?: L.Layer - setView?: boolean | string - flyTo?: boolean - keepCurrentZoomLevel?: boolean - clickBehavior?: any - returnToPrevBounds?: boolean - cacheLocation?: boolean - drawCircle?: boolean - drawMarker?: boolean - markerClass?: any - circleStyle?: L.PathOptions - markerStyle?: L.PathOptions - followCircleStyle?: L.PathOptions - followMarkerStyle?: L.PathOptions - icon?: string - iconLoading?: string - iconElementTag?: string - circlePadding?: number[] - onLocationError?: any - onLocationOutsideMapBounds?: any - showPopup?: boolean - strings?: any - locateOptions?: L.LocateOptions + interface LocateOptions { + position?: string; + layer?: L.Layer; + setView?: boolean | string; + flyTo?: boolean; + keepCurrentZoomLevel?: boolean; + clickBehavior?: any; + returnToPrevBounds?: boolean; + cacheLocation?: boolean; + drawCircle?: boolean; + drawMarker?: boolean; + markerClass?: any; + circleStyle?: L.PathOptions; + markerStyle?: L.PathOptions; + followCircleStyle?: L.PathOptions; + followMarkerStyle?: L.PathOptions; + icon?: string; + iconLoading?: string; + iconElementTag?: string; + circlePadding?: number[]; + onLocationError?: any; + onLocationOutsideMapBounds?: any; + showPopup?: boolean; + strings?: any; + locateOptions?: L.LocateOptions; } } - namespace control { /** - * Creates a Leaflet.Locate control - */ - export function locate(options?: Control.LocateOptions): L.Control.Locate; + * Creates a Leaflet.Locate control + */ + function locate(options?: Control.LocateOptions): L.Control; } } diff --git a/types/leaflet.locatecontrol/leaflet.locatecontrol-tests.ts b/types/leaflet.locatecontrol/leaflet.locatecontrol-tests.ts index 40fc41142f..59ab7f246f 100644 --- a/types/leaflet.locatecontrol/leaflet.locatecontrol-tests.ts +++ b/types/leaflet.locatecontrol/leaflet.locatecontrol-tests.ts @@ -1,4 +1,4 @@ -var map = L.map('map', { +const map = L.map('map', { center: [51.505, -0.09], zoom: 13 }); @@ -7,7 +7,7 @@ var map = L.map('map', { L.control.locate().addTo(map); // Simple -var lc = L.control.locate({ +const lc = L.control.locate({ position: 'topright', strings: { title: "Show me where I am, yo!" @@ -19,4 +19,4 @@ map.addControl(L.control.locate({ locateOptions: { maxZoom: 10, enableHighAccuracy: true -}})); \ No newline at end of file +}}));