ts-maps 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  import { Evented } from '../core/Events';
2
+ import { TsMap } from '../map/Map';
2
3
  export declare class Layer extends Evented {
3
4
  _map?: any;
4
5
  _mapToAdd?: any;
@@ -16,3 +17,11 @@ export declare class Layer extends Evented {
16
17
  getAttribution(): string | null | undefined;
17
18
  _layerAdd(e: any): void;
18
19
  }
20
+ declare module '../map/Map' {
21
+ interface TsMap {
22
+ addLayer: (layer: Layer) => this
23
+ removeLayer: (layer: Layer) => this
24
+ hasLayer: (layer: Layer) => boolean
25
+ eachLayer: (method: (layer: Layer) => void, context?: unknown) => this
26
+ }
27
+ }
@@ -1,5 +1,7 @@
1
1
  import { DivOverlay } from './DivOverlay';
2
+ import { Layer } from './Layer';
2
3
  import { Point } from '../geometry/Point';
4
+ import { TsMap } from '../map/Map';
3
5
  export declare class Popup extends DivOverlay {
4
6
  _wrapper?: HTMLElement;
5
7
  _tipContainer?: HTMLElement;
@@ -16,3 +18,21 @@ export declare class Popup extends DivOverlay {
16
18
  _adjustPan(): void;
17
19
  _getAnchor(): Point;
18
20
  }
21
+ declare module '../map/Map' {
22
+ interface TsMap {
23
+ openPopup: (popup: Popup | string | HTMLElement, latlng?: unknown, options?: Record<string, unknown>) => this
24
+ closePopup: (popup?: Popup) => this
25
+ }
26
+ }
27
+ declare module './Layer' {
28
+ interface Layer {
29
+ bindPopup: (content: Popup | string | HTMLElement, options?: Record<string, unknown>) => this
30
+ unbindPopup: () => this
31
+ openPopup: (latlng?: unknown) => this
32
+ closePopup: () => this
33
+ togglePopup: () => this
34
+ isPopupOpen: () => boolean
35
+ setPopupContent: (content: string | HTMLElement) => this
36
+ getPopup: () => Popup | undefined
37
+ }
38
+ }
@@ -131,7 +131,6 @@ export declare class TsMap extends Evented {
131
131
  touchRotate?: any;
132
132
  touchPitch?: any;
133
133
  _popup?: any;
134
- closePopup?: () => void;
135
134
  _style?: Style;
136
135
  _featureState?: globalThis.Map<string, Record<string, unknown>>;
137
136
  _layerHandlers?: globalThis.Map<string, Array<{
package/dist/index.js CHANGED
@@ -9736,7 +9736,6 @@ var init_Map = __esm(() => {
9736
9736
  _initControlPos;
9737
9737
  _clearControlPos;
9738
9738
  _addLayers;
9739
- closePopup;
9740
9739
  initialize(id, options) {
9741
9740
  options = setOptions(this, options);
9742
9741
  this._handlers = [];
@@ -18415,7 +18414,7 @@ init_storage();
18415
18414
  init_GLContext();
18416
18415
  init_WebGLTileRenderer();
18417
18416
  // src/core-map/index.ts
18418
- var version = "0.3.0";
18417
+ var version = "0.3.1";
18419
18418
  function factory(Ctor) {
18420
18419
  return (...args) => new Ctor(...args);
18421
18420
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ts-maps",
3
3
  "type": "module",
4
- "version": "0.3.0",
4
+ "version": "0.3.1",
5
5
  "description": "A modern vector map library.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",