Skip to content

Commit 6891f0d

Browse files
committed
FIX adding Controls as TS types
1 parent ca6a5a1 commit 6891f0d

File tree

117 files changed

+1608
-3175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+1608
-3175
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,25 @@
2525
- `VideoSource`
2626
- `MapMLGL`
2727

28+
- FIX: The following class have been extended to provide greater compatibility with SDK,s MapL
29+
- `Popup`
30+
- `Marker`
31+
- `Style`
32+
- `CanvasSource`
33+
- `GeoJSONSource`
34+
- `ImageSource`
35+
- `RasterDEMTileSource`
36+
- `RasterTileSource`
37+
- `VectorTileSource`
38+
- `VideoSource`
39+
- `NavigationControl`
40+
- `GeolocateControl`
41+
- `AttributionControl`
42+
- `LogoControl`
43+
- `ScaleControl`
44+
- `FullscreenControl`
45+
- `TerrainControl`
46+
2847
## [v1.0.8](https://github.com/maptiler/maptiler-sdk-js/releases/tag/v1.0.8)
2948
- FIX: Since v1.0.7, the `Map` primary language (when custom) was no longer persistant on style update.
3049

demos/maptiler-sdk.umd.js

Lines changed: 55 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/maptiler-sdk.d.ts

Lines changed: 73 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -427,14 +427,69 @@ declare class VideoSource extends maplibre_gl__default.VideoSource {
427427
onAdd(map: Map | Map$1): void;
428428
}
429429

430-
declare const GeolocateControl$1: typeof maplibre_gl.GeolocateControl;
430+
/**
431+
* This is an extension of MapLibre NavigationControl to make it fully type compatible with the SDK
432+
*/
433+
434+
declare class NavigationControl extends maplibre_gl__default.NavigationControl {
435+
onAdd(map: Map | Map$1): HTMLElement;
436+
}
437+
438+
/**
439+
* This is an extension of MapLibre GeolocateControl to make it fully type compatible with the SDK
440+
*/
441+
442+
declare class GeolocateControl extends maplibre_gl__default.GeolocateControl {
443+
onAdd(map: Map | Map$1): HTMLElement;
444+
}
445+
446+
/**
447+
* This is an extension of MapLibre AttributionControl to make it fully type compatible with the SDK
448+
*/
449+
450+
declare class AttributionControl extends maplibre_gl__default.AttributionControl {
451+
onAdd(map: Map | Map$1): HTMLElement;
452+
}
453+
454+
/**
455+
* This is an extension of MapLibre LogoControl to make it fully type compatible with the SDK
456+
*/
457+
458+
declare class LogoControl extends maplibre_gl__default.LogoControl {
459+
onAdd(map: Map | Map$1): HTMLElement;
460+
}
461+
462+
/**
463+
* This is an extension of MapLibre ScaleControl to make it fully type compatible with the SDK
464+
*/
465+
466+
declare class ScaleControl extends maplibre_gl__default.ScaleControl {
467+
onAdd(map: Map | Map$1): HTMLElement;
468+
}
469+
470+
/**
471+
* This is an extension of MapLibre FullscreenControl to make it fully type compatible with the SDK
472+
*/
473+
474+
declare class FullscreenControl extends maplibre_gl__default.FullscreenControl {
475+
onAdd(map: Map | Map$1): HTMLElement;
476+
}
477+
478+
/**
479+
* This is an extension of MapLibre TerrainControl to make it fully type compatible with the SDK
480+
*/
481+
482+
declare class TerrainControl extends maplibre_gl__default.TerrainControl {
483+
onAdd(map: Map | Map$1): HTMLElement;
484+
}
485+
431486
/**
432487
* The MaptilerGeolocateControl is an extension of the original GeolocateControl
433488
* with a few changes. In this version, the active mode persists as long as the
434489
* location is still centered. This means it's robust to rotation, pitch and zoom.
435490
*
436491
*/
437-
declare class MaptilerGeolocateControl extends GeolocateControl$1 {
492+
declare class MaptilerGeolocateControl extends GeolocateControl {
438493
private lastUpdatedCenter;
439494
/**
440495
* Update the camera location to center on the current position
@@ -456,7 +511,7 @@ declare type LogoOptions = LogoOptions$1 & {
456511
* This LogoControl extends the MapLibre LogoControl but instead can use any image URL and
457512
* any link URL. By default this is using MapTiler logo and URL.
458513
*/
459-
declare class MaptilerLogoControl extends maplibre_gl__default.LogoControl {
514+
declare class MaptilerLogoControl extends LogoControl {
460515
private logoURL;
461516
private linkURL;
462517
constructor(options?: LogoOptions);
@@ -671,20 +726,20 @@ declare const workerUrl: string;
671726
declare const addProtocol: (customProtocol: string, loadFn: (requestParameters: maplibre_gl.RequestParameters, callback: maplibre_gl.ResponseCallback<any>) => maplibre_gl.Cancelable) => void;
672727
declare const removeProtocol: (customProtocol: string) => void;
673728

674-
declare const NavigationControl: typeof maplibre_gl.NavigationControl;
675-
declare type NavigationControl = InstanceType<typeof NavigationControl>;
676-
declare const GeolocateControl: typeof maplibre_gl.GeolocateControl;
677-
declare type GeolocateControl = InstanceType<typeof GeolocateControl>;
678-
declare const AttributionControl: typeof maplibre_gl.AttributionControl;
679-
declare type AttributionControl = InstanceType<typeof AttributionControl>;
680-
declare const LogoControl: typeof maplibre_gl.LogoControl;
681-
declare type LogoControl = InstanceType<typeof LogoControl>;
682-
declare const ScaleControl: typeof maplibre_gl.ScaleControl;
683-
declare type ScaleControl = InstanceType<typeof ScaleControl>;
684-
declare const FullscreenControl: typeof maplibre_gl.FullscreenControl;
685-
declare type FullscreenControl = InstanceType<typeof FullscreenControl>;
686-
declare const TerrainControl: typeof maplibre_gl.TerrainControl;
687-
declare type TerrainControl = InstanceType<typeof TerrainControl>;
729+
declare const NavigationControlMLGL: typeof maplibre_gl.NavigationControl;
730+
declare type NavigationControlMLGL = InstanceType<typeof NavigationControlMLGL>;
731+
declare const GeolocateControlMLGL: typeof maplibre_gl.GeolocateControl;
732+
declare type GeolocateControlMLGL = InstanceType<typeof GeolocateControlMLGL>;
733+
declare const AttributionControlMLGL: typeof maplibre_gl.AttributionControl;
734+
declare type AttributionControlMLGL = InstanceType<typeof AttributionControlMLGL>;
735+
declare const LogoControlMLGL: typeof maplibre_gl.LogoControl;
736+
declare type LogoControlMLGL = InstanceType<typeof LogoControlMLGL>;
737+
declare const ScaleControlMLGL: typeof maplibre_gl.ScaleControl;
738+
declare type ScaleControlMLGL = InstanceType<typeof ScaleControlMLGL>;
739+
declare const FullscreenControlMLGL: typeof maplibre_gl.FullscreenControl;
740+
declare type FullscreenControlMLGL = InstanceType<typeof FullscreenControlMLGL>;
741+
declare const TerrainControlMLGL: typeof maplibre_gl.TerrainControl;
742+
declare type TerrainControlMLGL = InstanceType<typeof TerrainControlMLGL>;
688743
declare const MarkerMLGL: typeof maplibre_gl.Marker;
689744
declare type MarkerMLGL = InstanceType<typeof MarkerMLGL>;
690745
declare const PopupMLGL: typeof maplibre_gl.Popup;
@@ -718,4 +773,4 @@ declare type VideoSourceMLGL = InstanceType<typeof VideoSourceMLGL>;
718773
declare const MapMLGL: typeof maplibre_gl.Map;
719774
declare type MapMLGL = InstanceType<typeof MapMLGL>;
720775

721-
export { AJAXError, AttributionControl, CanvasSource, CanvasSourceMLGL, Evented, FullscreenControl, GeoJSONSource, GeoJSONSourceMLGL, GeolocateControl, GeolocationType, ImageSource, ImageSourceMLGL, Language, LanguageKey, LanguageString, LngLat, LngLatBounds, LogoControl, Map, MapMLGL, MapOptions, MaptilerGeolocateControl, MaptilerLogoControl, MaptilerTerrainControl, Marker, MarkerMLGL, Matrix2, MercatorCoordinate, NavigationControl, Point, Popup, PopupMLGL, RasterDEMTileSource, RasterDEMTileSourceMLGL, RasterTileSource, RasterTileSourceMLGL, ScaleControl, SdkConfig, Style, StyleMLGL, TerrainControl, Unit, VectorTileSource, VectorTileSourceMLGL, VideoSource, VideoSourceMLGL, addProtocol, clearPrewarmedResources, clearStorage, config, getRTLTextPluginStatus, maxParallelImageRequests, prewarm, removeProtocol, setRTLTextPlugin, supported, version, workerCount, workerUrl };
776+
export { AJAXError, AttributionControl, AttributionControlMLGL, CanvasSource, CanvasSourceMLGL, Evented, FullscreenControl, FullscreenControlMLGL, GeoJSONSource, GeoJSONSourceMLGL, GeolocateControl, GeolocateControlMLGL, GeolocationType, ImageSource, ImageSourceMLGL, Language, LanguageKey, LanguageString, LngLat, LngLatBounds, LogoControl, LogoControlMLGL, Map, MapMLGL, MapOptions, MaptilerGeolocateControl, MaptilerLogoControl, MaptilerTerrainControl, Marker, MarkerMLGL, Matrix2, MercatorCoordinate, NavigationControl, NavigationControlMLGL, Point, Popup, PopupMLGL, RasterDEMTileSource, RasterDEMTileSourceMLGL, RasterTileSource, RasterTileSourceMLGL, ScaleControl, ScaleControlMLGL, SdkConfig, Style, StyleMLGL, TerrainControl, TerrainControlMLGL, Unit, VectorTileSource, VectorTileSourceMLGL, VideoSource, VideoSourceMLGL, addProtocol, clearPrewarmedResources, clearStorage, config, getRTLTextPluginStatus, maxParallelImageRequests, prewarm, removeProtocol, setRTLTextPlugin, supported, version, workerCount, workerUrl };

dist/maptiler-sdk.min.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)