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

Support Leaflet 1.2.0 #21

Open
wants to merge 2 commits into
base: master
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
20 changes: 16 additions & 4 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,23 @@
<head>
<title>Leaflet.MeasureControl</title>

<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.min.css">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" />
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"
integrity="sha512-M2wvCLH6DSRazYeZRIm1JnYyh22purTM+FDB5CsyxtQJYeKq83arPe5wgbNmcFXGqiSH2XR8dT/fJISVA1r/zQ=="
crossorigin=""/>
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="leaflet-draw/dist/leaflet.draw.css" />
<link rel="stylesheet" href="leaflet.measurecontrol.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"
integrity="sha512-lInM/apFSqyy1o6s89K4iQUKg6ppXEgsVxT35HbzUupEVRh2Eu9Wdl4tHj7dZO0s1uvplcYGmt3498TtHq+log=="
crossorigin=""></script>

<script src="leaflet-draw/dist/leaflet.draw.js"></script>

<script src="https://unpkg.com/leaflet.measurecontrol@1.0.0"></script>
<script src="../leaflet.measurecontrol.min.js"></script>
<style>

</style>
Expand Down Expand Up @@ -47,7 +55,11 @@ <h1>A control to mesure distances</h1>
.setView([48.49, 1.4], 16)
.addLayer(osm);

L.Control.measureControl().addTo(map);
L.Control.measureControl({
handler : {
feet: false
}
}).addTo(map);
</script>
<script src="menu.js" charset="utf-8"></script>
</body>
Expand Down
14 changes: 14 additions & 0 deletions docs/leaflet-draw/.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:
20 changes: 20 additions & 0 deletions docs/leaflet-draw/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"rules": {
"no-unused-vars": 0,
"quotes": 0,
"no-shadow": 0,
"no-irregular-whitespace": 0,
"no-console": 0,
"no-extend-native": 0
},
"env": {
"mocha": true
},
"globals": {
"expect": false,
"sinon": false,
"happen": false,
"Hand": false,
"takeScreenshot": true
}
}
17 changes: 17 additions & 0 deletions docs/leaflet-draw/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
node_modules
.DS_Store
tmp/**/*
.idea
*.iml
_site
*.sublime-*
dist/*.js
dist/*.css
dist/*.map
coverage/
*.js.html
.mailmap
bower.json
component.json
debug/local/
Gemfile.lock
28 changes: 28 additions & 0 deletions docs/leaflet-draw/.travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,43 @@
language: node_js
node_js:
- "6.1"
- "6.0"
- "5.11"
- "5.10"
- "5.9"
- "5.8"
- "5.7"
- "5.6"
- "5.5"
- "5.4"
- "5.3"
- "5.2"
- "5.1"
- "5.0"
- "4.4"
- "4.3"
- "4.2"
- "4.1"
- "4.0"
- "0.12"
- "0.11"
- "0.10"
- "0.8"
- "0.6"
- "iojs"
- "iojs-v1.0.4"

matrix:
allow_failures:
- node_js: "0.8"
- node_js: "0.6"
- node_js: "0.12"
- node_js: "0.11"
- node_js: "0.10"
- node_js: "0.8"
- node_js: "0.6"
- node_js: "iojs"
- node_js: "iojs-v1.0.4"

before_script:
- npm install -g jake
30 changes: 24 additions & 6 deletions docs/leaflet-draw/BREAKINGCHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
# How to upgrade from 0.3 to 0.4

There are a number of changes to the plugin in 0.4 that may break peoples implementations of Leaflet.draw 0.3.

### L.Tooltip is now L.Draw.Tooltip

```
var tooltip = new L.Tooltip(map);
```

Is now

```
var tooltip = new L.Draw.Tooltip(map);
```

See ./src/Tooltip.js

# How to upgrade from 0.1 to 0.2

There are a number of changes to the plugin in 0.2 that may break peoples implementations of Leaflet.draw 0.1. If you I will try my best to list any changes here.
There are a number of changes to the plugin in 0.2 that may break peoples implementations of Leaflet.draw 0.1. I will try my best to list any changes here.

## Event consolidation

Expand All @@ -10,8 +28,8 @@ The vector or marker is accessed by the `layer` property of the event arguments,

#### New way

````js
map.on('draw:created', function (e) {
```js
map.on(L.Draw.Event.CREATED, function (e) {
var type = e.layerType,
layer = e.layer;

Expand All @@ -21,11 +39,11 @@ map.on('draw:created', function (e) {

map.addLayer(layer);
});
````
```

#### Old way

````js
```js
map.on('draw:poly-created', function (e) {
map.addLayer(e.poly);
});
Expand All @@ -39,7 +57,7 @@ map.on('draw:marker-created', function (e) {
e.marker.bindPopup('A popup!');
map.addLayer(e.marker);
});
````
```

## Draw handler started/stopped event change

Expand Down
41 changes: 41 additions & 0 deletions docs/leaflet-draw/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,47 @@ 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

* Documentation is now automatically generated
* L.Draw.Event is new, has all events in string format

### Bugfixes

* Travis tests

## 0.4.1 (October 21, 2016)

### Bugfixes

* fix markers becomming invisible when in edit mode
* Fix linking for EditPolyOptions
* Fixes very minor issue in readme with invalid variable name

## 0.4.0 (October 13, 2016)

### Improvements

* Add support for Leaflet 1.0.0+

### Bugfixes

* New L.Draw.Tooltip to mitigate L.Tooltip collision

### Potential Issues

* Several namespace changes, see BREAKINGCHANGES.md
* Cross support for both 0.7.0 and 1.0.0

## 0.3.0 (March 09, 2016)

### Improvements
Expand Down
24 changes: 24 additions & 0 deletions docs/leaflet-draw/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
- [ ] I'm reporting a bug, not asking for help
- [ ] I've looked at the [documentation](http://leaflet.github.io/Leaflet.draw/dist/reference-0.4.1.html) to make sure the behaviour is documented and expected
- [ ] I'm sure this is a Leaflet Draw code issue, not an issue with my own code nor with the framework I'm using (Cordova, Ionic, Angular, React…)
- [ ] I've searched through the issues to make sure it's not yet reported

----

## How to reproduce

- Leaflet version I'm using:
- Leaflet Draw version I'm using:
- Browser (with version) I'm using:
- OS/Platform (with version) I'm using:
- step 1
- step 2

## What behaviour I'm expecting and which behaviour I'm seeing

## Minimal example reproducing the issue

- [ ] this example is as simple as possible
- [ ] this example does not rely on any third party code

Using [jsfiddle](https://jsfiddle.net/ddproxy/mvp7hgou/) or another example site.
70 changes: 47 additions & 23 deletions docs/leaflet-draw/Jakefile.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,71 @@
/*
Leaflet.draw building and linting scripts.
Leaflet.draw building and linting scripts.

To use, install Node, then run the following commands in the project root:
To use, install Node, then run the following commands in the project root:

npm install -g jake
npm install
npm install -g jake
npm install

To check the code for errors and build Leaflet from source, run "jake".
To run the tests, run "jake test".
To check the code for errors and build Leaflet from source, run "jake".
To run the tests, run "jake test". To build the documentation, run "jake docs".

For a custom build, open build/build.html in the browser and follow the instructions.
*/
For a custom build, open build/build.html in the browser and follow the instructions.
*/

var build = require('./build/build.js');
var build = require('./build/build.js'),
buildDocs = require('./build/docs'),
git = require('git-rev');

function hint(msg, paths) {
function hint(msg, args) {
return function () {
console.log(msg);
jake.exec('node node_modules/jshint/bin/jshint -c ' + paths,
{printStdout: true}, function () {
console.log('\tCheck passed.\n');
complete();
});
jake.exec('node node_modules/eslint/bin/eslint.js ' + args,
{printStdout: true}, function () {
console.log('\tCheck passed.\n');
complete();
});
};
}

desc('Check Leaflet.draw source for errors with JSHint');
task('lint', {async: true}, hint('Checking for JS errors...', 'build/hintrc.js src'));
// Returns the version string in package.json, plus a semver build metadata if
// this is not an official release
function calculateVersion(officialRelease, callback) {
var version = require('./package.json').version;

if (officialRelease) {
callback(version);
} else {
git.short(function (str) {
callback(version + '+' + str);
});
}
}


desc('Check Leaflet.draw source for errors with ESHint');
task('lint', {async: true}, hint('Checking for JS errors...', 'src'));

desc('Check Leaflet.draw specs source for errors with JSHint');
task('lintspec', {async: true}, hint('Checking for specs JS errors...', 'spec/spec.hintrc.js spec/suites'));
desc('Check Leaflet.draw specs source for errors with ESLint');
task('lintspec', {async: true}, hint('Checking for specs JS errors...', 'spec/suites'));

desc('Combine and compress Leaflet.draw source files');
task('build', {async: true}, function () {
build.build(complete);
desc('Combine and compress Leaflet Draw source files');
task('build', {async: true}, function (compsBase32, buildName, officialRelease) {
calculateVersion(officialRelease, function (v) {
build.build(complete, v, compsBase32, buildName);
});
});

desc('Run PhantomJS tests');
task('test', ['lint', 'lintspec'], {async: true}, function () {
build.test(complete);
});

task('default', ['test', 'build']);
desc('Build documentation');
task('docs', {}, function () {
buildDocs();
});

task('default', ['build', 'test']);

jake.addListener('complete', function () {
process.exit();
Expand Down
2 changes: 1 addition & 1 deletion docs/leaflet-draw/MIT-LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2012-2016 Jacob Toye and Leaflet
Copyright 2012-2017 Jacob Toye and Leaflet

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
Loading