Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions types/woosmap.map/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,19 @@ declare namespace woosmap.map.Data {
getType(): "GeometryCollection";
}
}
declare namespace woosmap.map {
/**
* ImageMapType defines tiled image layer that can be added to the map.
* It supports both `xyz` and `tms` tile schemes.
*/
class ImageMapType {
/**
* ImageMapType defines tiled image layer that can be added to the map.
* It supports both `xyz` and `tms` tile schemes.
*/
constructor(opts: woosmap.map.ImageMapTypeOptions);
}
}
declare namespace woosmap.map {
class BaseGeometry extends woosmap.map.MVCObject {
constructor(options: woosmap.map.GeometryOptions);
Expand Down Expand Up @@ -1939,6 +1952,35 @@ declare namespace woosmap.map {
type: "FeatureCollection";
}
}
declare namespace woosmap.map {
interface ImageMapTypeOptions {
alt?: string | null;
getTileUrl?: (point: woosmap.map.Point, zoom: number) => (string | null) | null;
/**
* The maximum zoom level at which the image map type should be visible.
*/
maxZoom?: number | null;
/**
* The minimum zoom level at which the image map type should be visible.
*/
minZoom?: number | null;
name?: string | null;
/**
* Opacity of the tile layer (between 0, 1).
*/
opacity?: number | null;
/**
* The tile scheme to use `xyz` or `tms`.
*/
scheme?: "xyz" | "tms";
tileSize?: woosmap.map.Size | null;
/**
* The tile url scheme use {x}, {y} and {z} url templates.
* Example: `https://tile.openstreetmap.org/{z}/{x}/{y}.png`
*/
url?: string;
}
}
declare namespace woosmap.map {
interface GeometryOptions {
clickable?: boolean | null;
Expand Down
10 changes: 10 additions & 0 deletions types/woosmap.map/woosmap.map-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,16 @@ const field2 = woosmap.map.query.F("type", "myType");
// $ExpectType Field | Field[]
field2;

const imageMapTypeOptions = expectType({
url: "http://tile-server/{z}/{x}/{y}.png",
opacity: 0.5,
tileSize: new woosmap.map.Size(256, 256),
}) as woosmap.map.ImageMapTypeOptions;

const imageMapType = new woosmap.map.ImageMapType(imageMapTypeOptions);
// $ExpectType ImageMapType
imageMapType;

/**
* helper functions for testing purpose
*/
Expand Down