Skip to content

Commit ca6a5a1

Browse files
committed
FIX extending MapLibre classes
1 parent b764e92 commit ca6a5a1

File tree

132 files changed

+5297
-2678
lines changed

Some content is hidden

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

132 files changed

+5297
-2678
lines changed

demos/maptiler-sdk.umd.js

Lines changed: 80 additions & 10 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: 102 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as maplibre_gl from 'maplibre-gl';
2-
import maplibre_gl__default, { MapOptions as MapOptions$1, StyleSpecification, ControlPosition, StyleOptions, LogoOptions as LogoOptions$1 } from 'maplibre-gl';
2+
import maplibre_gl__default, { MapOptions as MapOptions$1, StyleSpecification, ControlPosition, StyleOptions, Map as Map$1, LogoOptions as LogoOptions$1 } from 'maplibre-gl';
33
export * from 'maplibre-gl';
44
import * as _mapbox_mapbox_gl_supported from '@mapbox/mapbox-gl-supported';
55
import { FetchFunction, ReferenceMapStyle, MapStyleVariant } from '@maptiler/client';
@@ -347,6 +347,86 @@ declare class Map extends maplibre_gl__default.Map {
347347
getMaptilerSessionId(): string;
348348
}
349349

350+
/**
351+
* This is an extension of MapLibre Marker to make it fully type compatible with the SDK
352+
*/
353+
354+
declare class Marker extends maplibre_gl__default.Marker {
355+
addTo(map: Map | Map$1): this;
356+
}
357+
358+
/**
359+
* This is an extension of MapLibre Popup to make it fully type compatible with the SDK
360+
*/
361+
362+
declare class Popup extends maplibre_gl__default.Popup {
363+
addTo(map: Map | Map$1): this;
364+
}
365+
366+
/**
367+
* This is an extension of MapLibre Style to make it fully type compatible with the SDK
368+
*/
369+
370+
declare class Style extends maplibre_gl__default.Style {
371+
constructor(map: Map, options?: StyleOptions);
372+
}
373+
374+
/**
375+
* This is an extension of MapLibre CanvasSource to make it fully type compatible with the SDK
376+
*/
377+
378+
declare class CanvasSource extends maplibre_gl__default.CanvasSource {
379+
onAdd(map: Map | Map$1): void;
380+
}
381+
382+
/**
383+
* This is an extension of MapLibre GeoJSONSource to make it fully type compatible with the SDK
384+
*/
385+
386+
declare class GeoJSONSource extends maplibre_gl__default.GeoJSONSource {
387+
onAdd(map: Map | Map$1): void;
388+
}
389+
390+
/**
391+
* This is an extension of MapLibre ImageSource to make it fully type compatible with the SDK
392+
*/
393+
394+
declare class ImageSource extends maplibre_gl__default.ImageSource {
395+
onAdd(map: Map | Map$1): void;
396+
}
397+
398+
/**
399+
* This is an extension of MapLibre RasterTileSource to make it fully type compatible with the SDK
400+
*/
401+
402+
declare class RasterTileSource extends maplibre_gl__default.RasterTileSource {
403+
onAdd(map: Map | Map$1): void;
404+
}
405+
406+
/**
407+
* This is an extension of MapLibre RasterDEMTileSource to make it fully type compatible with the SDK
408+
*/
409+
410+
declare class RasterDEMTileSource extends maplibre_gl__default.RasterDEMTileSource {
411+
onAdd(map: Map | Map$1): void;
412+
}
413+
414+
/**
415+
* This is an extension of MapLibre VectorTileSource to make it fully type compatible with the SDK
416+
*/
417+
418+
declare class VectorTileSource extends maplibre_gl__default.VectorTileSource {
419+
onAdd(map: Map | Map$1): void;
420+
}
421+
422+
/**
423+
* This is an extension of MapLibre VideoSource to make it fully type compatible with the SDK
424+
*/
425+
426+
declare class VideoSource extends maplibre_gl__default.VideoSource {
427+
onAdd(map: Map | Map$1): void;
428+
}
429+
350430
declare const GeolocateControl$1: typeof maplibre_gl.GeolocateControl;
351431
/**
352432
* The MaptilerGeolocateControl is an extension of the original GeolocateControl
@@ -605,12 +685,12 @@ declare const FullscreenControl: typeof maplibre_gl.FullscreenControl;
605685
declare type FullscreenControl = InstanceType<typeof FullscreenControl>;
606686
declare const TerrainControl: typeof maplibre_gl.TerrainControl;
607687
declare type TerrainControl = InstanceType<typeof TerrainControl>;
608-
declare const Popup: typeof maplibre_gl.Popup;
609-
declare type Popup = InstanceType<typeof Popup>;
610-
declare const Marker: typeof maplibre_gl.Marker;
611-
declare type Marker = InstanceType<typeof Marker>;
612-
declare const Style: typeof maplibre_gl.Style;
613-
declare type Style = InstanceType<typeof Style>;
688+
declare const MarkerMLGL: typeof maplibre_gl.Marker;
689+
declare type MarkerMLGL = InstanceType<typeof MarkerMLGL>;
690+
declare const PopupMLGL: typeof maplibre_gl.Popup;
691+
declare type PopupMLGL = InstanceType<typeof PopupMLGL>;
692+
declare const StyleMLGL: typeof maplibre_gl.Style;
693+
declare type StyleMLGL = InstanceType<typeof StyleMLGL>;
614694
declare const LngLat: typeof maplibre_gl.LngLat;
615695
declare type LngLat = InstanceType<typeof LngLat>;
616696
declare const LngLatBounds: typeof maplibre_gl.LngLatBounds;
@@ -621,21 +701,21 @@ declare const Evented: typeof maplibre_gl.Evented;
621701
declare type Evented = InstanceType<typeof Evented>;
622702
declare const AJAXError: typeof maplibre_gl.AJAXError;
623703
declare type AJAXError = InstanceType<typeof AJAXError>;
624-
declare const CanvasSource: typeof maplibre_gl.CanvasSource;
625-
declare type CanvasSource = InstanceType<typeof CanvasSource>;
626-
declare const GeoJSONSource: typeof maplibre_gl.GeoJSONSource;
627-
declare type GeoJSONSource = InstanceType<typeof GeoJSONSource>;
628-
declare const ImageSource: typeof maplibre_gl.ImageSource;
629-
declare type ImageSource = InstanceType<typeof ImageSource>;
630-
declare const RasterDEMTileSource: typeof maplibre_gl.RasterDEMTileSource;
631-
declare type RasterDEMTileSource = InstanceType<typeof RasterDEMTileSource>;
632-
declare const RasterTileSource: typeof maplibre_gl.RasterTileSource;
633-
declare type RasterTileSource = InstanceType<typeof RasterTileSource>;
634-
declare const VectorTileSource: typeof maplibre_gl.VectorTileSource;
635-
declare type VectorTileSource = InstanceType<typeof VectorTileSource>;
636-
declare const VideoSource: typeof maplibre_gl.VideoSource;
637-
declare type VideoSource = InstanceType<typeof VideoSource>;
704+
declare const CanvasSourceMLGL: typeof maplibre_gl.CanvasSource;
705+
declare type CanvasSourceMLGL = InstanceType<typeof CanvasSourceMLGL>;
706+
declare const GeoJSONSourceMLGL: typeof maplibre_gl.GeoJSONSource;
707+
declare type GeoJSONSourceMLGL = InstanceType<typeof GeoJSONSourceMLGL>;
708+
declare const ImageSourceMLGL: typeof maplibre_gl.ImageSource;
709+
declare type ImageSourceMLGL = InstanceType<typeof ImageSourceMLGL>;
710+
declare const RasterDEMTileSourceMLGL: typeof maplibre_gl.RasterDEMTileSource;
711+
declare type RasterDEMTileSourceMLGL = InstanceType<typeof RasterDEMTileSourceMLGL>;
712+
declare const RasterTileSourceMLGL: typeof maplibre_gl.RasterTileSource;
713+
declare type RasterTileSourceMLGL = InstanceType<typeof RasterTileSourceMLGL>;
714+
declare const VectorTileSourceMLGL: typeof maplibre_gl.VectorTileSource;
715+
declare type VectorTileSourceMLGL = InstanceType<typeof VectorTileSourceMLGL>;
716+
declare const VideoSourceMLGL: typeof maplibre_gl.VideoSource;
717+
declare type VideoSourceMLGL = InstanceType<typeof VideoSourceMLGL>;
638718
declare const MapMLGL: typeof maplibre_gl.Map;
639719
declare type MapMLGL = InstanceType<typeof MapMLGL>;
640720

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 };
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 };

dist/maptiler-sdk.min.mjs

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

0 commit comments

Comments
 (0)