Skip to content

Commit

Permalink
Update dependencies and readme
Browse files Browse the repository at this point in the history
Updated dependencies, especially jasmine to 2.0.0
  • Loading branch information
MrMufflon committed Feb 24, 2014
1 parent 3224e0a commit 714cca3
Show file tree
Hide file tree
Showing 13 changed files with 101 additions and 3,470 deletions.
3 changes: 3 additions & 0 deletions Gruntfile.js
Expand Up @@ -123,4 +123,7 @@ module.exports = function(grunt) {
// Default task(s).
grunt.registerTask('default', ['clean', 'jshint', 'connect', 'jasmine', 'concat', 'uglify', 'less', 'cssmin', 'svg2png']);

grunt.registerTask('test', ['connect', 'jasmine']);


};
39 changes: 39 additions & 0 deletions README.md
@@ -1,6 +1,11 @@
Leaflet.Elevation
=================

1. [What is this?](https://github.com/MrMufflon/Leaflet.Elevation#what-is-this)
2. [How to use](https://github.com/MrMufflon/Leaflet.Elevation#how-to-use)
3. [Setup development environment](https://github.com/MrMufflon/Leaflet.Elevation#setup-development-environment)
4. [Customizing styles](https://github.com/MrMufflon/Leaflet.Elevation#customizing-styles)

### What is this?
A [Leaflet](http://leafletjs.com) plugin to view an interactive height profile of polylines lines using [d3](http://d3js.org). Currently Chrome, Firefox and IE 10+ are supported and tested.
This plugin is under development.
Expand Down Expand Up @@ -57,3 +62,37 @@ g.addTo(map);
// reset data and display
el.clear();
```

### Setup development environment
If you are new to grunt please refer to the [quick start](http://gruntjs.com/getting-started) guide.

Install npm dependencies with
```
npm install
```

Run jasmine tests with
```
grunt test
```

And compile with
```
grunt
```

### Customizing styles
To generate different themes [lessCSS](http://lesscss.org/) is used. Create your own theme in a new .less file in src/css/themes. Usable variables are
```css
@theme : lime-theme;
@base-color : #9CC222; //basecolor to derive other colors from
@highlight-color : #637E0B; //basecolor to derive selections from
@background : fade(@base-color,20%); //background-color
@drag-color : fade(@highlight-color,40%); //drag selection color
@axis-color : darken(@base-color,20%); //color of axes
@stroke-color : darken(@base-color,40%); //color for mouse highlight
@stroke-width-mouse-focus : 1; //stroke width for mouse highlight
@stroke-width-height-focus: 2; //stroke width for height focus indicator
@stroke-width-axis : 2; //stroke width for axes;
```
Add the theme file to the less- and cssmin task in the Gruntfile and you´re good to go.
2 changes: 1 addition & 1 deletion dist/Leaflet.Elevation-0.0.2.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/Leaflet.Elevation-0.0.2.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/Leaflet.Elevation-0.0.2.src.js
Expand Up @@ -502,7 +502,7 @@ L.Control.Elevation = L.Control.extend({
var s = new L.LatLng(coords[i][1], coords[i][0]);
var e = new L.LatLng(coords[i ? i - 1 : 0][1], coords[i ? i - 1 : 0][0]);
var newdist = s.distanceTo(e);
dist = dist + newdist / 1000;
dist = dist + Math.round(newdist / 1000 * 100000) / 100000;
ele = ele < coords[i][2] ? coords[i][2] : ele;
data.push({
dist: dist,
Expand Down Expand Up @@ -530,7 +530,7 @@ L.Control.Elevation = L.Control.extend({
var s = coords[i];
var e = coords[i ? i - 1 : 0];
var newdist = s.distanceTo(e);
dist = dist + newdist / 1000;
dist = dist + Math.round(newdist / 1000 * 100000) / 100000;
ele = ele < s.meta.ele ? s.meta.ele : ele;
data.push({
dist: dist,
Expand Down
20 changes: 0 additions & 20 deletions lib/jasmine-1.3.1/MIT.LICENSE

This file was deleted.

0 comments on commit 714cca3

Please sign in to comment.