From 05513e0a0ad8acd01216587583de7b4bee2eae9a Mon Sep 17 00:00:00 2001 From: Denis Date: Thu, 30 Mar 2017 08:30:25 -0400 Subject: [PATCH 1/4] leaflet.locate - remove useless package.json --- types/leaflet.locatecontrol/index.d.ts | 2 +- types/leaflet.locatecontrol/package.json | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 types/leaflet.locatecontrol/package.json diff --git a/types/leaflet.locatecontrol/index.d.ts b/types/leaflet.locatecontrol/index.d.ts index 3f4d94e9ce..5758caed85 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 diff --git a/types/leaflet.locatecontrol/package.json b/types/leaflet.locatecontrol/package.json deleted file mode 100644 index 8afe476d51..0000000000 --- a/types/leaflet.locatecontrol/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "@types/leaflet": "^1.0.58" - } -} From 29cf119a4665469a83667e9bc61b4442b2080aa5 Mon Sep 17 00:00:00 2001 From: Denis Date: Thu, 30 Mar 2017 08:31:43 -0400 Subject: [PATCH 2/4] Update with typeRoots --- types/leaflet.locatecontrol/tsconfig.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/leaflet.locatecontrol/tsconfig.json b/types/leaflet.locatecontrol/tsconfig.json index 0637d48285..0ccab11228 100644 --- a/types/leaflet.locatecontrol/tsconfig.json +++ b/types/leaflet.locatecontrol/tsconfig.json @@ -9,6 +9,9 @@ "noImplicitThis": true, "strictNullChecks": true, "baseUrl": "../", + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true From 93410826e1d07c3846424a6397cc66bfd92ba5e6 Mon Sep 17 00:00:00 2001 From: Denis Date: Thu, 30 Mar 2017 17:49:01 -0400 Subject: [PATCH 3/4] Fix linting --- types/leaflet.locatecontrol/index.d.ts | 52 +++++++++---------- .../leaflet.locatecontrol-tests.ts | 6 +-- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/types/leaflet.locatecontrol/index.d.ts b/types/leaflet.locatecontrol/index.d.ts index 5758caed85..056e7b0d32 100644 --- a/types/leaflet.locatecontrol/index.d.ts +++ b/types/leaflet.locatecontrol/index.d.ts @@ -7,32 +7,32 @@ 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 Locate extends L.Control {} + 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; } } 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 +}})); From efc8be0ec6c964fd8e17500dde3888b2c3f80bbe Mon Sep 17 00:00:00 2001 From: Denis Date: Thu, 30 Mar 2017 20:38:17 -0400 Subject: [PATCH 4/4] Fix linting --- types/leaflet.locatecontrol/index.d.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/types/leaflet.locatecontrol/index.d.ts b/types/leaflet.locatecontrol/index.d.ts index 056e7b0d32..7692c2bb60 100644 --- a/types/leaflet.locatecontrol/index.d.ts +++ b/types/leaflet.locatecontrol/index.d.ts @@ -7,7 +7,6 @@ declare namespace L { namespace Control { - interface Locate extends L.Control {} interface LocateOptions { position?: string; layer?: L.Layer; @@ -35,11 +34,10 @@ declare namespace L { 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; } }