Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update typescript definitions #791

Closed
wants to merge 6 commits into from

Conversation

hoetmaaiers
Copy link
Contributor

I have added my local typescript definitions to match the documation and my own usage. This is far from complete but just an update for my current project.

Referring: #790

The event system is harder to type and is added in comment. Any help is surely welcome.

@Falke-Design Falke-Design changed the base branch from master to develop March 22, 2021 17:44
@Falke-Design
Copy link
Collaborator

@hoetmaaiers can you please resolve the merge conflict and pull the newest develop version? We will create a release this week and it would be nice to have this PR in

Copy link
Collaborator

@Falke-Design Falke-Design left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you want to update this changes but it is not necessary to merge this PR

| 'Line'
| 'Rectangle'
| 'Polygon'
| 'Cut';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add CircleMarker
Is ImageOverlay missing here? They are only editable not drawable


export type GEOMAN_MAP_DRAG_MODE_EVENTS = 'pm:globaldrawmodetoggled';

export type GEOMAN_MAP_REMOVAL_MODE_EVENTS = 'pm:globalremovalmodetoggled';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

globaldrawmodetoggled is missing


export type GEOMAN_MAP_EDIT_MODE_EVENTS = 'pm:globaleditmodetoggled';

export type GEOMAN_MAP_DRAG_MODE_EVENTS = 'pm:globaldrawmodetoggled';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export type GEOMAN_MAP_DRAG_MODE_EVENTS = 'pm:globaldrawmodetoggled';
export type GEOMAN_MAP_DRAG_MODE_EVENTS = 'pm:globaldragmodetoggled';

Comment on lines +37 to +46
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';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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_EDIT_MODE_EVENTS =
| 'pm:edit'
| 'pm:update'
| 'pm:enable'
| 'pm:disable'
| 'pm:vertexadded'
| 'pm:vertexremoved'
| 'pm:vertexclick'
| 'pm:markerdragstart'
| 'pm:markerdrag'
| 'pm:markerdragend'
| 'pm:layerrest'
| 'pm:snapdrag'
| 'pm:snap'
| 'pm:unsnap'
| 'pm:intersect'
| 'pm:centerplaced';

| 'pm:dragend';

export type GEOMAN_LAYER_CUT_MODE_EVENTS = 'pm:cut';

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +78 to +82
export class LayerDrawOptions {
snappable?: boolean;
snapDistance?: number;
allowSelfIntersection?: boolean;
preventMarkerRemoval?: boolean;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export class LayerDrawOptions {
snappable?: boolean;
snapDistance?: number;
allowSelfIntersection?: boolean;
preventMarkerRemoval?: boolean;
export class LayerDrawOptions {
snappable?: boolean;
snapDistance?: number;
allowSelfIntersection?: boolean;
allowSelfIntersectionEdit?: boolean;
preventMarkerRemoval?: boolean;
removeLayerBelowMinVertexCount?: boolean;
limitMarkersToCount?: number;
limitMarkersToZoom?: number;
limitMarkersToViewport?: boolean;
limitMarkersToClick?: boolean;
pinning?: boolean;

Maybe this should named EditOptions because it is for edit mode

Comment on lines +143 to +153
lang:
| 'en'
| 'de'
| 'it'
| 'ru'
| 'ro'
| 'es'
| 'fr'
| 'pt_br'
| 'zh'
| 'nl',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lang:
| 'en'
| 'de'
| 'it'
| 'ru'
| 'ro'
| 'es'
| 'fr'
| 'pt_br'
| 'zh'
| 'nl',
lang:
| 'da'
| 'de'
| 'el'
| 'en'
| 'es'
| 'fa'
| 'fr'
| 'hu'
| 'id'
| 'it'
| 'nl'
| 'no'
| 'pl'
| 'pt_br'
| 'ro'
| 'ru'
| 'sv'
| 'tr'
| 'ua'
| 'zh'
| 'zh_tw';

| 'pm:dragend';

export type GEOMAN_LAYER_CUT_MODE_EVENTS = 'pm:cut';

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

| 'pm:dragend';

export type GEOMAN_LAYER_CUT_MODE_EVENTS = 'pm:cut';

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pm:buttonclick and pm:actionclick are missing
https://github.com/geoman-io/leaflet-geoman/tree/develop#actions

Comment on lines +85 to +96
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;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in current develop version

interface LayerOptions {
pmIgnore?: boolean
interface Map {
addControls(options?: DrawControlOptions): void;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • controlsVisible()
  • globalCutModeEnabled
  • enableGlobalCutMode
  • toggleGlobalCutMode
  • disableGlobalCutMode
  • globalEditModeEnabled
  • enableGlobalDragMode
  • disableGlobalDragMode
  • globalDragModeEnabled
  • toggleGlobalDragMode
  • enableGlobalRemovalMode
  • disableGlobalRemovalMode
  • globalRemovalModeEnabled
  • toggleGlobalRemovalMode

#821


interface MapOptions {
pmIgnore?: boolean;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interface PM

  • reInitLayer()
  • setOptIn

@codeofsumit
Copy link
Contributor

Closing this one in favor of #825

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants