Skip to content

Commit b764e92

Browse files
committed
FIX MapLibre class instance type export
1 parent 6e526f0 commit b764e92

File tree

99 files changed

+6258
-1523
lines changed

Some content is hidden

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

99 files changed

+6258
-1523
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,6 @@ typings/
104104
.tern-port
105105
.DS_Store
106106

107-
.vscode
107+
.vscode
108+
109+
demos/tmp_*

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
11
# Changelog
2+
## [v1.0.9](https://github.com/maptiler/maptiler-sdk-js/releases/tag/v1.0.9)
3+
- FIX: The instance types for the following MapLibre classes are now fully exported:
4+
- `NavigationControl`
5+
- `GeolocateControl`
6+
- `AttributionControl`
7+
- `LogoControl`
8+
- `ScaleControl`
9+
- `FullscreenControl`
10+
- `TerrainControl`
11+
- `Popup`
12+
- `Marker`
13+
- `Style`
14+
- `LngLat`
15+
- `LngLatBounds`
16+
- `MercatorCoordinate`
17+
- `Evented`
18+
- `AJAXError`
19+
- `CanvasSource`
20+
- `GeoJSONSource`
21+
- `ImageSource`
22+
- `RasterDEMTileSource`
23+
- `RasterTileSource`
24+
- `VectorTileSource`
25+
- `VideoSource`
26+
- `MapMLGL`
27+
228
## [v1.0.8](https://github.com/maptiler/maptiler-sdk-js/releases/tag/v1.0.8)
329
- FIX: Since v1.0.7, the `Map` primary language (when custom) was no longer persistant on style update.
430

demos/maptiler-sdk.umd.js

Lines changed: 2 additions & 2 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: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,6 @@ declare type MapOptions = Omit<MapOptions$1, "style" | "maplibreLogo"> & {
254254
* The Map class can be instanciated to display a map in a `<div>`
255255
*/
256256
declare class Map extends maplibre_gl__default.Map {
257-
private languageShouldUpdate;
258-
private isStyleInitialized;
259257
private isTerrainEnabled;
260258
private terrainExaggeration;
261259
private primaryLanguage;
@@ -583,36 +581,61 @@ declare class Point {
583581
declare const supported: _mapbox_mapbox_gl_supported.IsSupported;
584582
declare const setRTLTextPlugin: (url: string, callback: (error?: Error) => void, deferred?: boolean) => void;
585583
declare const getRTLTextPluginStatus: () => string;
584+
declare const prewarm: () => void;
585+
declare const clearPrewarmedResources: () => void;
586+
declare const version: string;
587+
declare const workerCount: number;
588+
declare const maxParallelImageRequests: number;
589+
declare const clearStorage: (callback?: (err?: Error) => void) => void;
590+
declare const workerUrl: string;
591+
declare const addProtocol: (customProtocol: string, loadFn: (requestParameters: maplibre_gl.RequestParameters, callback: maplibre_gl.ResponseCallback<any>) => maplibre_gl.Cancelable) => void;
592+
declare const removeProtocol: (customProtocol: string) => void;
593+
586594
declare const NavigationControl: typeof maplibre_gl.NavigationControl;
595+
declare type NavigationControl = InstanceType<typeof NavigationControl>;
587596
declare const GeolocateControl: typeof maplibre_gl.GeolocateControl;
597+
declare type GeolocateControl = InstanceType<typeof GeolocateControl>;
588598
declare const AttributionControl: typeof maplibre_gl.AttributionControl;
599+
declare type AttributionControl = InstanceType<typeof AttributionControl>;
589600
declare const LogoControl: typeof maplibre_gl.LogoControl;
601+
declare type LogoControl = InstanceType<typeof LogoControl>;
590602
declare const ScaleControl: typeof maplibre_gl.ScaleControl;
603+
declare type ScaleControl = InstanceType<typeof ScaleControl>;
591604
declare const FullscreenControl: typeof maplibre_gl.FullscreenControl;
605+
declare type FullscreenControl = InstanceType<typeof FullscreenControl>;
592606
declare const TerrainControl: typeof maplibre_gl.TerrainControl;
607+
declare type TerrainControl = InstanceType<typeof TerrainControl>;
593608
declare const Popup: typeof maplibre_gl.Popup;
609+
declare type Popup = InstanceType<typeof Popup>;
594610
declare const Marker: typeof maplibre_gl.Marker;
611+
declare type Marker = InstanceType<typeof Marker>;
595612
declare const Style: typeof maplibre_gl.Style;
613+
declare type Style = InstanceType<typeof Style>;
596614
declare const LngLat: typeof maplibre_gl.LngLat;
615+
declare type LngLat = InstanceType<typeof LngLat>;
597616
declare const LngLatBounds: typeof maplibre_gl.LngLatBounds;
617+
declare type LngLatBounds = InstanceType<typeof LngLatBounds>;
598618
declare const MercatorCoordinate: typeof maplibre_gl.MercatorCoordinate;
619+
declare type MercatorCoordinate = InstanceType<typeof MercatorCoordinate>;
599620
declare const Evented: typeof maplibre_gl.Evented;
621+
declare type Evented = InstanceType<typeof Evented>;
600622
declare const AJAXError: typeof maplibre_gl.AJAXError;
623+
declare type AJAXError = InstanceType<typeof AJAXError>;
601624
declare const CanvasSource: typeof maplibre_gl.CanvasSource;
625+
declare type CanvasSource = InstanceType<typeof CanvasSource>;
602626
declare const GeoJSONSource: typeof maplibre_gl.GeoJSONSource;
627+
declare type GeoJSONSource = InstanceType<typeof GeoJSONSource>;
603628
declare const ImageSource: typeof maplibre_gl.ImageSource;
629+
declare type ImageSource = InstanceType<typeof ImageSource>;
604630
declare const RasterDEMTileSource: typeof maplibre_gl.RasterDEMTileSource;
631+
declare type RasterDEMTileSource = InstanceType<typeof RasterDEMTileSource>;
605632
declare const RasterTileSource: typeof maplibre_gl.RasterTileSource;
633+
declare type RasterTileSource = InstanceType<typeof RasterTileSource>;
606634
declare const VectorTileSource: typeof maplibre_gl.VectorTileSource;
635+
declare type VectorTileSource = InstanceType<typeof VectorTileSource>;
607636
declare const VideoSource: typeof maplibre_gl.VideoSource;
608-
declare const prewarm: () => void;
609-
declare const clearPrewarmedResources: () => void;
610-
declare const version: string;
611-
declare const workerCount: number;
612-
declare const maxParallelImageRequests: number;
613-
declare const clearStorage: (callback?: (err?: Error) => void) => void;
614-
declare const workerUrl: string;
615-
declare const addProtocol: (customProtocol: string, loadFn: (requestParameters: maplibre_gl.RequestParameters, callback: maplibre_gl.ResponseCallback<any>) => maplibre_gl.Cancelable) => void;
616-
declare const removeProtocol: (customProtocol: string) => void;
637+
declare type VideoSource = InstanceType<typeof VideoSource>;
638+
declare const MapMLGL: typeof maplibre_gl.Map;
639+
declare type MapMLGL = InstanceType<typeof MapMLGL>;
617640

618-
export { AJAXError, AttributionControl, CanvasSource, Evented, FullscreenControl, GeoJSONSource, GeolocateControl, GeolocationType, ImageSource, Language, LanguageKey, LanguageString, LngLat, LngLatBounds, LogoControl, Map, MapOptions, MaptilerGeolocateControl, MaptilerLogoControl, MaptilerTerrainControl, Marker, Matrix2, MercatorCoordinate, NavigationControl, Point, Popup, RasterDEMTileSource, RasterTileSource, ScaleControl, SdkConfig, Style, TerrainControl, Unit, VectorTileSource, VideoSource, addProtocol, clearPrewarmedResources, clearStorage, config, getRTLTextPluginStatus, maxParallelImageRequests, prewarm, removeProtocol, setRTLTextPlugin, supported, version, workerCount, workerUrl };
641+
export { AJAXError, AttributionControl, CanvasSource, Evented, FullscreenControl, GeoJSONSource, GeolocateControl, GeolocationType, ImageSource, Language, LanguageKey, LanguageString, LngLat, LngLatBounds, LogoControl, Map, MapMLGL, MapOptions, MaptilerGeolocateControl, MaptilerLogoControl, MaptilerTerrainControl, Marker, Matrix2, MercatorCoordinate, NavigationControl, Point, Popup, RasterDEMTileSource, RasterTileSource, ScaleControl, SdkConfig, Style, TerrainControl, Unit, VectorTileSource, VideoSource, 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.

dist/maptiler-sdk.mjs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -575,8 +575,6 @@ class Map extends maplibregl__default.Map {
575575
};
576576
}
577577
}));
578-
this.languageShouldUpdate = false;
579-
this.isStyleInitialized = false;
580578
this.isTerrainEnabled = false;
581579
this.terrainExaggeration = 1;
582580
this.primaryLanguage = null;
@@ -1155,6 +1153,7 @@ const {
11551153
addProtocol,
11561154
removeProtocol
11571155
} = maplibregl__default;
1156+
const MapMLGL = maplibregl__default.Map;
11581157

1159-
export { AJAXError, AttributionControl, CanvasSource, Evented, FullscreenControl, GeoJSONSource, GeolocateControl, GeolocationType, ImageSource, Language, LngLat, LngLatBounds, LogoControl, Map, MaptilerGeolocateControl, MaptilerLogoControl, MaptilerTerrainControl, Marker, MercatorCoordinate, NavigationControl, Point, Popup, RasterDEMTileSource, RasterTileSource, ScaleControl, SdkConfig, Style, TerrainControl, VectorTileSource, VideoSource, addProtocol, clearPrewarmedResources, clearStorage, config, getRTLTextPluginStatus, maxParallelImageRequests, prewarm, removeProtocol, setRTLTextPlugin, supported, version, workerCount, workerUrl };
1158+
export { AJAXError, AttributionControl, CanvasSource, Evented, FullscreenControl, GeoJSONSource, GeolocateControl, GeolocationType, ImageSource, Language, LngLat, LngLatBounds, LogoControl, Map, MapMLGL, MaptilerGeolocateControl, MaptilerLogoControl, MaptilerTerrainControl, Marker, MercatorCoordinate, NavigationControl, Point, Popup, RasterDEMTileSource, RasterTileSource, ScaleControl, SdkConfig, Style, TerrainControl, VectorTileSource, VideoSource, addProtocol, clearPrewarmedResources, clearStorage, config, getRTLTextPluginStatus, maxParallelImageRequests, prewarm, removeProtocol, setRTLTextPlugin, supported, version, workerCount, workerUrl };
11601159
//# sourceMappingURL=maptiler-sdk.mjs.map

dist/maptiler-sdk.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/maptiler-sdk.umd.js

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

dist/maptiler-sdk.umd.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/maptiler-sdk.umd.min.js

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

0 commit comments

Comments
 (0)