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

Add the ability to draw curves #1008

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from
Open
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
21 changes: 14 additions & 7 deletions build/deps.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,40 @@ var deps = {
],
desc: 'The core of the plugin. Currently only includes the version.'
},

Common: {
src: ['ext/CurveCommon.js'],
desc: 'The files shared with multiple objects of the plugin.'
},

DrawHandlers: {
src: [
'draw/handler/Draw.Feature.js',
'draw/handler/Draw.Polyline.js',
'draw/handler/Draw.Curve.js',
'draw/handler/Draw.Polygon.js',
'draw/handler/Draw.SimpleShape.js',
'draw/handler/Draw.Rectangle.js',
'draw/handler/Draw.Marker.js',
'draw/handler/Draw.CircleMarker.js',
'draw/handler/Draw.Circle.js'
'draw/handler/Draw.Marker.js',
'draw/handler/Draw.CircleMarker.js',
'draw/handler/Draw.Circle.js'
Comment on lines -17 to +25
Copy link

Choose a reason for hiding this comment

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

Whitespace-only changes should be avoided

],
desc: 'Drawing handlers for: polylines, polygons, rectangles, circles, circlemarkers and markers.',
deps: ['Core']
deps: ['Core', 'Common']
},

EditHandlers: {
src: [
'edit/handler/Edit.Marker.js',
'edit/handler/Edit.Poly.js',
'edit/handler/Edit.Curve.js',
'edit/handler/Edit.SimpleShape.js',
'edit/handler/Edit.Rectangle.js',
'edit/handler/Edit.CircleMarker.js',
'edit/handler/Edit.CircleMarker.js',
Copy link

Choose a reason for hiding this comment

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

?

'edit/handler/Edit.Circle.js'
],
desc: 'Editing handlers for: polylines, polygons, rectangles, circlemarkers and circles.',
deps: ['Core']
desc: 'Editing handlers for: polylines, curves, polygons, rectangles, circlemarkers and circles.',
deps: ['Core', 'Common']
},

Extensions: {
Expand Down
2 changes: 2 additions & 0 deletions build/docs-index.leafdoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ This file just defines the order of the classes in the docs.
@class L.Draw.Polyline
@class L.Draw.Rectangle
@class L.Draw.Polygon
@class L.Draw.Curve

@class L.Edit.SimpleShape
@class L.Edit.Marker
@class L.Edit.CircleMarker
@class L.Edit.Circle
@class L.Edit.Polyline
@class L.Edit.Curve
@class L.Edit.Rectangle
@class L.EditToolbar.Edit
@class L.EditToolbar.Delete
Expand Down
9 changes: 9 additions & 0 deletions build/docs-misc.leafdoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ for this section of the documentation, please edit docs-misc.leafdoc in the buil
| --------- | ----- | --------- | ------------- |
| polyline | [PolylineOptions](#polylineoptions) | `{ }` | Polyline draw handler options. Set to `false` to disable handler. |
| polygon | [PolygonOptions](#polygonoptions) | `{ }` | Polygon draw handler options. Set to `false` to disable handler. |
| curve | [CurveOptions](#curveoptions) | `{ }` | Curve draw handler options. Set to `false` to disable handler. |
| rectangle | [RectangleOptions](#rectangleoptions) | `{ }` | Rectangle draw handler options. Set to `false` to disable handler. |
| circle | [CircleOptions](#circleoptions) | `{ }` | Circle draw handler options. Set to `false` to disable handler. |
| marker | [MarkerOptions](#markeroptions) | `{ }` | Marker draw handler options. Set to `false` to disable handler. |
Expand Down Expand Up @@ -75,6 +76,14 @@ for this section of the documentation, please edit docs-misc.leafdoc in the buil
| precision | Object | `{km: 2, ha: 2, m: 0, mi: 2, ac: 2, yd: 0, ft: 0, nm: 2}` | Defines the precision to use for numbers of each type of unit. Possible units are `km` (kilometers), `ha` (hectares), `m` (metres), `mi` (miles), `ac` (acres), `ya` (yards), `ft` (feet), `nm` (nautical miles). For example `{km: 1}` changes the default precision for km and km² to one which gives values like `1.5 km` and `15.0 km²` in stead of `1.53 km` and `15.01 km²`.


@namespace CurveOptions

| Option | Type | Default | Description
| --- | --- | --- | ---
| shapeOptions | [Leaflet Path options](http://leafletjs.com/reference.html#path-options) | [See code](https://github.com/Leaflet/Leaflet.draw/blob/master/src/draw/handler/Draw.Curve.js#L19) | The options used when drawing the curve on the map.
| shapeGuideOptions | [Leaflet Path options](http://leafletjs.com/reference.html#path-options) | [See code](https://github.com/Leaflet/Leaflet.draw/blob/master/src/draw/handler/Draw.Curve.js#L27) | The options used when drawing preview curve on mouse hover/drag.
| repeatMode | Bool | `false` | Determines if the draw tool remains enabled after drawing a shape.

@namespace RectangleOptions

| Option | Type | Default | Description
Expand Down
Binary file modified dist/images/spritesheet-2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dist/images/spritesheet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
275 changes: 146 additions & 129 deletions dist/images/spritesheet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading