Skip to content

Commit

Permalink
Merge branch 'undo-manager' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ddproxy authored Jul 14, 2017
2 parents 094bea5 + 4b553bd commit 84cd25e
Show file tree
Hide file tree
Showing 28 changed files with 11,006 additions and 4,456 deletions.
14 changes: 14 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
engines:
fixme:
enabled: true
duplication:
enabled: true
config:
languages:
- javascript
eslint:
enabled: true
ratings:
paths:
- "**.js"
exclude_paths:
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ node_modules
.DS_Store
tmp/**/*
.idea
*.bak
*.iml
_site
*.sublime-*
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ Leaflet.draw Changelog

An in-progress version being developed on the master branch.

## 0.4.10 (July 3, 2017)

* Locking Leaflet version to 0.7.x-1.0.x
* Polygon line length, square kilometers and configurable precision
* fix for _getMeasurementString
* Locale number formatting added

## 0.4.2 (November 7, 2016)

### Improvements
Expand Down
9 changes: 9 additions & 0 deletions Leaflet.draw.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ Leaflet.draw 0.2.0 changes a LOT of things from 0.1. Please see [BREAKING CHANGE
- [Contributing](#contributing)
- [Thanks](#thanks)


<a name="customlanguage" />
## Customizing language and text in Leaflet.draw

Leaflet.draw uses the `L.drawLocal` configuration object to set any text used in the plugin. Customizing this will allow support for changing the text or supporting another language.
Expand All @@ -37,15 +35,14 @@ See [Leaflet.draw.js](https://github.com/Leaflet/Leaflet.draw/blob/master/src/Le

E.g.

````js
```js
// Set the button title text for the polygon button
L.drawLocal.draw.toolbar.buttons.polygon = 'Draw a sexy polygon!';

// Set the tooltip start text for the rectangle
L.drawLocal.draw.handlers.rectangle.tooltip.start = 'Not telling...';
````
```

<a name="commontasks" />
## Common tasks

The following examples outline some common tasks.
Expand Down Expand Up @@ -132,19 +129,18 @@ You can change a draw handlers options after initialisation by using the `setDra

E.g. to change the colour of the rectangle:

````js
```js
drawControl.setDrawingOptions({
rectangle: {
shapeOptions: {
color: '#0000FF'
}
}
});
````
```

<a name="contributing" />
# Contributing

## Testing

To test you can install the npm dependencies:
Expand Down
6 changes: 3 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "leaflet-draw",
"description": "Vector drawing plugin for Leaflet",
"version": "0.4.4",
"version": "0.4.10",
"main": [
"dist/leaflet.draw-src.js",
"dist/leaflet.draw.js",
"dist/leaflet.draw.css",
"dist/images/spritesheet-2x.png",
"dist/images/spritesheet.png",
Expand Down Expand Up @@ -48,7 +48,7 @@
"url": "https://github.com/Leaflet/Leaflet.draw.git"
},
"dependencies": {
"leaflet": "^1.0.0"
"leaflet": ">=0.7.0 <1.1"
},
"devDependencies": {
"eslint": "~3.5.0",
Expand Down
10 changes: 9 additions & 1 deletion build/docs-misc.leafdoc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ for this section of the documentation, please edit docs-misc.leafdoc in the buil
| drawError | Object | [See code](https://github.com/Leaflet/Leaflet.draw/blob/master/src/draw/handler/Draw.Polyline.js#L10) | Configuration options for the error that displays if an intersection is detected.
| guidelineDistance | Number | `20` | Distance in pixels between each guide dash.
| shapeOptions | [Leaflet Polyline options](http://leafletjs.com/reference.html#polyline-options) | [See code](https://github.com/Leaflet/Leaflet.draw/blob/master/src/draw/handler/Draw.Polyline.js#L20) | The options used when drawing the polyline/polygon on the map.
| metric | Bool | `true` | Determines which measurement system (metric or imperial) is used.
| showLength | Bool | `true` | Show the length of the drawn line. **The area is only approximate and become less accurate the larger the polygon is.**
| metric | Bool | `true` | Use the metric measurement system.
| feet | Bool | `true` | Use feet instead of yards and miles, when not using the metric measurement system.
| nautic | Bool | `false` | Use nautic miles instead of yards and miles, when not using the metric measurement system nor feet.
| zIndexOffset | Number | `2000` | This should be a high number to ensure that you can draw over all other layers on the map.
| repeatMode | Bool | `false` | Determines if the draw tool remains enabled after drawing a shape.

Expand All @@ -64,6 +67,11 @@ for this section of the documentation, please edit docs-misc.leafdoc in the buil
| Option | Type | Default | Description
| --- | --- | --- | ---
| showArea | Bool | `false` | Show the area of the drawn polygon in m², ha or km². **The area is only approximate and become less accurate the larger the polygon is.**
| showLength | Bool | `false` | Show the length of the drawn line. **The area is only approximate and become less accurate the larger the polygon is.**
| metric | Object | `true` | Use the metric measurement system. Can be a boolean value, but can also be an array to specify which units to use. Possible units are `km` (kilometers), `ha` (hectares), `m` (metres). So a value of `['km', 'm']` means that the length will be shown in metres and, when more than a 1000 metres, in kilometers, and the area will be shown in m² or km² and acres will not be used.
| feet | Bool | `true` | Use feet instead of yards and miles, when not using the metric measurement system.
| nautic | Bool | `false` | Use nautic miles instead of yards and miles, when not using the metric measurement system nor feet.
| 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 RectangleOptions
Expand Down
39 changes: 0 additions & 39 deletions build/hintrc.js

This file was deleted.

Empty file modified build/publish.sh
100644 → 100755
Empty file.
Loading

0 comments on commit 84cd25e

Please sign in to comment.