Skip to content

Commit

Permalink
fix: update types to use correct maplibre-gl types
Browse files Browse the repository at this point in the history
In some cases the types for Map and MapOptions might be
selected from leaflet instead of maplibre-gl. This solves it by
mapping the name of those types to something else so they
can't be overriden by leaflet.

Solves maplibre#40
  • Loading branch information
andreandersson authored May 21, 2024
1 parent adfd432 commit 54097ed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions leaflet-maplibre-gl.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as L from 'leaflet';
import { Map, MapOptions } from 'maplibre-gl';
import { Map as LibreGLMap, MapOptions as LibreGLMapOptions } from 'maplibre-gl';


declare module 'leaflet' {
type LeafletMaplibreGLOptions = Omit<MapOptions, "container">;
type LeafletMaplibreGLOptions = Omit<LibreGLMapOptions, "container">;

class MaplibreGL extends L.Layer {
constructor(options: LeafletMaplibreGLOptions);
getMaplibreMap(): Map
getMaplibreMap(): LibreGLMap
getCanvas(): HTMLCanvasElement
getSize(): L.Point
getBounds(): L.LatLngBounds
Expand Down

0 comments on commit 54097ed

Please sign in to comment.