From 8937f8deae5eb1e54ed78bcdf48e2460a5d49a80 Mon Sep 17 00:00:00 2001 From: cksadra Date: Wed, 6 Jan 2021 18:44:08 +0330 Subject: [PATCH 1/3] Update fa.json --- src/assets/translations/fa.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/assets/translations/fa.json b/src/assets/translations/fa.json index a957365e..0ae80740 100644 --- a/src/assets/translations/fa.json +++ b/src/assets/translations/fa.json @@ -21,12 +21,12 @@ "drawLineButton": "رسم خط", "drawCircleButton": "رسم دایره", "drawRectButton": "رسم چهارضلعی", - "editButton": "ویرایش لایه‌هل", + "editButton": "ویرایش لایه‌ها", "dragButton": "جابجایی لایه‌ها", "cutButton": "برش لایه‌ها", "deleteButton": "حذف لایه‌ها", "drawCircleMarkerButton": "رسم نشان دایره", - "snappingButton": "نشانگر را به لایه ها و رئوس دیگر بکشید", + "snappingButton": "نشانگر را به لایه‌ها و رئوس دیگر بکشید", "pinningButton": "رئوس مشترک را با هم پین کنید" } } From 4787b4e787a5d7436aaeedc1f6f8db3d4a3ccb27 Mon Sep 17 00:00:00 2001 From: Sumit Kumar Date: Sat, 6 Feb 2021 17:16:20 +0100 Subject: [PATCH 2/3] Revert "Update fa.json" --- src/assets/translations/fa.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/assets/translations/fa.json b/src/assets/translations/fa.json index 0ae80740..a957365e 100644 --- a/src/assets/translations/fa.json +++ b/src/assets/translations/fa.json @@ -21,12 +21,12 @@ "drawLineButton": "رسم خط", "drawCircleButton": "رسم دایره", "drawRectButton": "رسم چهارضلعی", - "editButton": "ویرایش لایه‌ها", + "editButton": "ویرایش لایه‌هل", "dragButton": "جابجایی لایه‌ها", "cutButton": "برش لایه‌ها", "deleteButton": "حذف لایه‌ها", "drawCircleMarkerButton": "رسم نشان دایره", - "snappingButton": "نشانگر را به لایه‌ها و رئوس دیگر بکشید", + "snappingButton": "نشانگر را به لایه ها و رئوس دیگر بکشید", "pinningButton": "رئوس مشترک را با هم پین کنید" } } From e14d7e6d73a11e4a6342d0c9a03b371e7d90ce14 Mon Sep 17 00:00:00 2001 From: hoetmaaiers Date: Mon, 8 Feb 2021 11:54:23 +0100 Subject: [PATCH 3/3] Update typescript definitions --- leaflet-geoman.d.ts | 317 +++++++++++++++++++++++--------------------- 1 file changed, 169 insertions(+), 148 deletions(-) diff --git a/leaflet-geoman.d.ts b/leaflet-geoman.d.ts index d7b90b48..960a9354 100644 --- a/leaflet-geoman.d.ts +++ b/leaflet-geoman.d.ts @@ -1,164 +1,185 @@ import * as L from 'leaflet'; declare module 'leaflet' { + export interface GeomanLayerOptions { + pmIgnore?: boolean; + } + + namespace PM { + export type SUPPORTED_SHAPES = + | 'Marker' + | 'Circle' + | 'Line' + | 'Rectangle' + | 'Polygon' + | 'Cut'; + + export type GEOMAN_MAP_DRAW_MODE_EVENTS = + | 'pm:drawstart' + | 'pm:drawend' + | 'pm:create'; + + export type GEOMAN_MAP_EDIT_MODE_EVENTS = 'pm:globaleditmodetoggled'; + + export type GEOMAN_MAP_DRAG_MODE_EVENTS = 'pm:globaldrawmodetoggled'; + + export type GEOMAN_MAP_REMOVAL_MODE_EVENTS = 'pm:globalremovalmodetoggled'; + + export type GEOMAN_MAP_CUT_MODE_EVENTS = 'pm:cut'; + + export type GEOMAN_LAYER_DRAW_MODE_EVENTS = + | 'pm:vertexadded' + | 'pm:snapdrag' + | 'pm:snap' + | 'pm:unsnap' + | 'pm:centerplaced'; + + export type GEOMAN_LAYER_EDIT_MODE_EVENTS = + | 'pm:edit' + | 'pm:vertexadded' + | 'pm:vertexremoved' + | 'pm:markerdragstart' + | 'pm:markerdragend' + | 'pm:snap' + | 'pm:unsnap' + | 'pm:intersect' + | 'pm:centerplaced'; + + export type GEOMAN_LAYER_DRAG_MODE_EVENTS = + | 'pm:dragstart' + | 'pm:drag' + | 'pm:dragend'; + + export type GEOMAN_LAYER_CUT_MODE_EVENTS = 'pm:cut'; + + export interface GeomanHelpers { + getShapes(): string[]; + } - export interface GeomanLayerOptions { - pmIgnore?: boolean; + export class MapDrawOptions { + snappable?: boolean; + snapDistance?: number; + snapMiddle?: boolean; + tooltips?: boolean; + allowSelfIntersection?: true; + templineStyle?: L.PathOptions; + hintlineStyle?: L.PathOptions; + cursorMarker?: boolean; + finishOn?: + | null + | 'click' + | 'dblclick' + | 'mousedown' + | 'mouseover' + | 'mouseout' + | 'contextmenu'; } - namespace PM { - export type SUPPORTED_SHAPES = ( - 'Marker' | 'Circle' | 'Line' | - 'Rectangle' | 'Polygon' | 'Cut' - ); - - export type GEOMAN_MAP_DRAW_MODE_EVENTS = ( - 'pm:drawstart' | 'pm:drawend' | 'pm:create' - ); - - export type GEOMAN_MAP_EDIT_MODE_EVENTS = ( - 'pm:globaleditmodetoggled' - ); - - export type GEOMAN_MAP_DRAG_MODE_EVENTS = ( - 'pm:globaldrawmodetoggled' - ); - - export type GEOMAN_MAP_REMOVAL_MODE_EVENTS = ( - 'pm:globalremovalmodetoggled' - ); - - export type GEOMAN_MAP_CUT_MODE_EVENTS = ( - 'pm:cut' - ); - - export type GEOMAN_LAYER_DRAW_MODE_EVENTS = ( - 'pm:vertexadded' | 'pm:snapdrag' | - 'pm:snap' | 'pm:unsnap' | - 'pm:centerplaced' - ); - - export type GEOMAN_LAYER_EDIT_MODE_EVENTS = ( - 'pm:edit' | 'pm:vertexadded' | 'pm:vertexremoved' | - 'pm:markerdragstart' | 'pm:markerdragend' | 'pm:snap' | - 'pm:unsnap' | 'pm:intersect' | 'pm:centerplaced' - ); - - export type GEOMAN_LAYER_DRAG_MODE_EVENTS = ( - 'pm:dragstart' | 'pm:drag' | 'pm:dragend' - ); - - export type GEOMAN_LAYER_CUT_MODE_EVENTS = ( - 'pm:cut' - ); - - export interface GeomanHelpers { - getShapes(): string[]; - } - - export class MapDrawOptions { - snappable?: boolean; - snapDistance?: number; - snapMiddle?: boolean; - tooltips?: boolean; - allowSelfIntersection?: true; - templineStyle?: L.PathOptions; - hintlineStyle?: L.PathOptions; - cursorMarker?: boolean; - finishOn?: null | 'click' | 'dblclick' | 'mousedown' | 'mouseover' | 'mouseout' | 'contextmenu'; - } - - export class LayerDrawOptions { - snappable?: boolean; - snapDistance?: number; - allowSelfIntersection?: boolean; - preventMarkerRemoval?: boolean; - } - - export class DrawControlOptions { - position?: ControlPosition; - drawMarker?: boolean; - drawCircleMarker?: boolean; - drawPolyline?: boolean; - drawRectangle?: boolean; - drawPolygon?: boolean; - drawCircle?: boolean; - editMode?: boolean; - dragMode?: boolean; - cutPolygon?: boolean; - removalMode?: boolean; - } - - export function initialize(options?: { optIn: boolean }): void; - - export class Translations { - tooltips?: { - placeMarker?: string; - firstVertex?: string; - continueLine?: string; - finishLine?: string; - finishPoly?: string; - finishRect?: string; - startCircle?: string; - finishCircle?: string; - placeCircleMarker?: string; - }; - - actions?: { - finish?: string; - cancel?: string; - removeLastVertex?: string; - }; - - buttonTitles?: { - drawMarkerButton?: string; - drawPolyButton?: string; - drawLineButton?: string; - drawCircleButton?: string; - drawRectButton?: string; - editButton?: string; - dragButton?: string; - cutButton?: string; - deleteButton?: string; - drawCircleMarkerButton?: string; - }; - } - - interface Map { - addControls(options?: DrawControlOptions): void; - enableDraw(shape: SUPPORTED_SHAPES, options?: MapDrawOptions): void; - disableDraw(shape: SUPPORTED_SHAPES): void; - enableGlobalEditMode(options): void; - disableGlobalEditMode(): void; - toggleGlobalEditMode(options): void; - globalEditEnabled(): boolean; - setLang(lang: 'en' | 'de' | 'it' | 'ru' | 'ro' | 'es' | 'fr' | 'pt_br' | 'zh' | 'nl', customTranslations?: Translations, fallbackLanguage?: string); - setPathOptions(options: PathOptions): void; - Draw: GeomanHelpers; - } - - interface Layer { - enable(options?: LayerDrawOptions): void; - disable(): void; - toggleEdit(options?: LayerDrawOptions): void; - enabled(): boolean; - hasSelfIntersection(): boolean; - } + export class LayerDrawOptions { + snappable?: boolean; + snapDistance?: number; + allowSelfIntersection?: boolean; + preventMarkerRemoval?: boolean; } - interface Map { - pm: PM.Map; + export class DrawControlOptions { + position?: ControlPosition; + drawMarker?: boolean; + drawCircleMarker?: boolean; + drawPolyline?: boolean; + drawRectangle?: boolean; + drawPolygon?: boolean; + drawCircle?: boolean; + editMode?: boolean; + dragMode?: boolean; + cutPolygon?: boolean; + removalMode?: boolean; } - interface Layer { - pm: PM.Layer + export function initialize(options?: { optIn: boolean }): void; + + export class Translations { + tooltips?: { + placeMarker?: string; + firstVertex?: string; + continueLine?: string; + finishLine?: string; + finishPoly?: string; + finishRect?: string; + startCircle?: string; + finishCircle?: string; + placeCircleMarker?: string; + }; + + actions?: { + finish?: string; + cancel?: string; + removeLastVertex?: string; + }; + + buttonTitles?: { + drawMarkerButton?: string; + drawPolyButton?: string; + drawLineButton?: string; + drawCircleButton?: string; + drawRectButton?: string; + editButton?: string; + dragButton?: string; + cutButton?: string; + deleteButton?: string; + drawCircleMarkerButton?: string; + }; } - interface LayerOptions { - pmIgnore?: boolean + interface Map { + addControls(options?: DrawControlOptions): void; + enableDraw(shape: SUPPORTED_SHAPES, options?: MapDrawOptions): void; + disableDraw(shape: SUPPORTED_SHAPES): void; + enableGlobalEditMode(options): void; + disableGlobalEditMode(): void; + toggleGlobalEditMode(options): void; + globalEditEnabled(): boolean; + setLang( + lang: + | 'en' + | 'de' + | 'it' + | 'ru' + | 'ro' + | 'es' + | 'fr' + | 'pt_br' + | 'zh' + | 'nl', + customTranslations?: Translations, + fallbackLanguage?: string + ); + setPathOptions(options: PathOptions): void; + Draw: GeomanHelpers; } - interface MapOptions { - pmIgnore?: boolean; + interface Layer { + enable(options?: LayerDrawOptions): void; + disable(): void; + toggleEdit(options?: LayerDrawOptions): void; + enabled(): boolean; + hasSelfIntersection(): boolean; } + } + + interface Map { + pm: PM.Map; + } + + interface Layer { + pm: PM.Layer; + } + + interface LayerOptions { + pmIgnore?: boolean; + } + + interface MapOptions { + pmIgnore?: boolean; + } }