Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

terra-draw

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

terra-draw - npm Package Compare versions

Comparing version 0.0.1-alpha.29 to 0.0.1-alpha.30

14

CHANGELOG.md

@@ -5,2 +5,16 @@ # Changelog

### [0.0.1-alpha.30](https://github.com/JamesLMilner/terra-draw/compare/v0.0.1-alpha.29...v0.0.1-alpha.30) (2023-05-21)
### Bug Fixes
* allow wait as a setCursor parameter ([839bb90](https://github.com/JamesLMilner/terra-draw/commit/839bb906999420931f3b2833be781688a2ec39be))
* clear now removes all rendered layers ([fd7a208](https://github.com/JamesLMilner/terra-draw/commit/fd7a2081338b4d6ebfc3e93a6580a38b9649343a))
* correctly name styling typings for rectangle mode ([a460a3a](https://github.com/JamesLMilner/terra-draw/commit/a460a3aa7411f275d72930f5d41bd76de107c1d9))
### Chore
* update docs ([ea4f52c](https://github.com/JamesLMilner/terra-draw/commit/ea4f52ca091772c8bed2c1b6c103db7b4734eb6e))
### [0.0.1-alpha.29](https://github.com/JamesLMilner/terra-draw/compare/v0.0.1-alpha.28...v0.0.1-alpha.29) (2023-05-14)

@@ -7,0 +21,0 @@

1

dist/adapters/common/base.adapter.d.ts

@@ -37,2 +37,3 @@ import { Project, Unproject, TerraDrawCallbacks, TerraDrawChanges, TerraDrawMouseEvent, SetCursor, TerraDrawStylingFunction, GetLngLatFromEvent } from "../../common";

unregister(): void;
abstract clear(): void;
abstract project(...args: Parameters<Project>): ReturnType<Project>;

@@ -39,0 +40,0 @@ abstract unproject(...args: Parameters<Unproject>): ReturnType<Unproject>;

@@ -74,2 +74,3 @@ /// <reference types="google.maps" />

setDraggability(enabled: boolean): void;
private renderedFeatures;
/**

@@ -81,2 +82,8 @@ * Renders GeoJSON features on the map using the provided styling configuration.

render(changes: TerraDrawChanges, styling: TerraDrawStylingFunction): void;
private clearLayers;
/**
* Clears the map and store of all rendered data layers
* @returns void
* */
clear(): void;
}

@@ -23,2 +23,16 @@ import { TerraDrawChanges, SetCursor, TerraDrawStylingFunction } from "../common";

private createPaneStyleSheet;
/**
* Clears the panes created by the adapter
* @returns void
* */
private clearPanes;
/**
* Clears the leaflet layers created by the adapter
* @returns void
* */
private clearLayers;
/**
* Styles a GeoJSON layer based on the styling function
* @param styling - The styling function
* */
private styleGeoJSONLayer;

@@ -80,2 +94,7 @@ /**

render(changes: TerraDrawChanges, styling: TerraDrawStylingFunction): void;
/**
* Clears the map and store of all rendered data layers
* @returns void
* */
clear(): void;
}

@@ -12,2 +12,7 @@ import { TerraDrawChanges, SetCursor, TerraDrawStylingFunction } from "../common";

private _rendered;
/**
* Clears the map of rendered layers and sources
* @returns void
* */
private clearLayers;
private _addGeoJSONSource;

@@ -76,2 +81,7 @@ private _addFillLayer;

render(changes: TerraDrawChanges, styling: TerraDrawStylingFunction): void;
/**
* Clears the map and store of all rendered data layers
* @returns void
* */
clear(): void;
}

@@ -1,2 +0,2 @@

import { TerraDrawChanges, SetCursor, TerraDrawStylingFunction } from "../common";
import { TerraDrawChanges, SetCursor, TerraDrawStylingFunction, TerraDrawCallbacks } from "../common";
import { Map } from "maplibre-gl";

@@ -10,2 +10,4 @@ import { TerraDrawBaseAdapter } from "./common/base.adapter";

});
register(callbacks: TerraDrawCallbacks): void;
unregister(): void;
/**

@@ -66,2 +68,7 @@ * Returns the longitude and latitude coordinates from a given PointerEvent on the map.

render(changes: TerraDrawChanges, styling: TerraDrawStylingFunction): void;
/**
* Clears the map and store of all rendered data layers
* @returns void
* */
clear(): void;
}

@@ -49,2 +49,7 @@ import { TerraDrawChanges, SetCursor, TerraDrawStylingFunction } from "../common";

private getStyles;
/**
* Clears the layers created by the adapter
* @returns void
* */
private clearLayers;
private addFeature;

@@ -107,3 +112,8 @@ private removeFeature;

render(changes: TerraDrawChanges, styling: TerraDrawStylingFunction): void;
/**
* Clears the map and store of all rendered data layers
* @returns void
* */
clear(): void;
}
export {};

4

dist/common.d.ts

@@ -27,3 +27,3 @@ import { StoreChangeHandler, GeoJSONStore, GeoJSONStoreFeatures } from "./store/store";

}
export type SetCursor = (cursor: "unset" | "grab" | "grabbing" | "crosshair" | "pointer") => void;
export type SetCursor = (cursor: "unset" | "grab" | "grabbing" | "crosshair" | "pointer" | "wait") => void;
export type Project = (lng: number, lat: number) => {

@@ -62,2 +62,3 @@ x: number;

onDragEnd: (event: TerraDrawMouseEvent, setMapDraggability: (enabled: boolean) => void) => void;
onClear: () => void;
}

@@ -82,2 +83,3 @@ export interface TerraDrawChanges {

render(changes: TerraDrawChanges, styling: TerraDrawStylingFunction): void;
clear(): void;
}

@@ -84,0 +86,0 @@ export declare const SELECT_PROPERTIES: {

@@ -34,2 +34,3 @@ import { BehaviorConfig, TerraDrawModeBehavior } from "./base.behavior";

abstract stop(): void;
abstract cleanUp(): void;
abstract styleFeature(feature: GeoJSONStoreFeatures): TerraDrawAdapterStyling;

@@ -36,0 +37,0 @@ onDeselect(deselectedId: string): void;

@@ -8,3 +8,3 @@ import { TerraDrawMouseEvent, TerraDrawAdapterStyling, TerraDrawKeyboardEvent, HexColor } from "../../common";

};
type FreehandPolygonStyling = {
type RectanglePolygonStyling = {
fillColor: HexColor;

@@ -15,3 +15,3 @@ outlineColor: HexColor;

};
export declare class TerraDrawRectangleMode extends TerraDrawBaseDrawMode<FreehandPolygonStyling> {
export declare class TerraDrawRectangleMode extends TerraDrawBaseDrawMode<RectanglePolygonStyling> {
mode: string;

@@ -23,3 +23,3 @@ private center;

constructor(options?: {
styles?: Partial<FreehandPolygonStyling>;
styles?: Partial<RectanglePolygonStyling>;
keyEvents?: TerraDrawRectangleModeKeyEvents | null;

@@ -26,0 +26,0 @@ });

@@ -32,4 +32,6 @@ import { TerraDrawAdapterStyling } from "../../common";

/** @internal */
cleanUp(): void;
/** @internal */
styleFeature(): TerraDrawAdapterStyling;
}
export {};

@@ -16,2 +16,3 @@ import { TerraDrawAdapterStyling } from "../../common";

onMouseMove(): void;
cleanUp(): void;
styleFeature(): {

@@ -18,0 +19,0 @@ pointColor: `#${string}`;

@@ -64,3 +64,4 @@ import { TerraDrawGoogleMapsAdapter } from "./adapters/google-maps.adapter";

/**
* Removes all data from the current store
* Removes all data from the current store and removes any rendered layers
* via the registering the adapter.
*

@@ -103,3 +104,4 @@ * @alpha

/**
* A method starting the current mode if it has not been started already
* A method starting Terra Draw. It put the instance into a started state, and
* in registers the passed adapter giving it all the callbacks required to operate.
*

@@ -110,3 +112,4 @@ * @alpha

/**
* A a method for stopping the current mode
* A method for stopping Terra Draw. Will clear the store, deregister the adapter and
* remove any rendered layers in the process.
*

@@ -113,0 +116,0 @@ * @alpha

{
"name": "terra-draw",
"version": "0.0.1-alpha.29",
"version": "0.0.1-alpha.30",
"description": "Frictionless map drawing across mapping provider",

@@ -5,0 +5,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc