Skip to content

Commit 6604444

Browse files
authored
Merge pull request #55 from henrythasler/better-split
refactor `split`-functions
2 parents 4366102 + ad29de4 commit 6604444

27 files changed

Lines changed: 1040 additions & 503 deletions

DEVELOPMENT.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ sudo npm install -g np npm
1212

1313
## References
1414

15-
## Typescript
15+
## Typescript, Javascript
1616

1717
- ['this' in TypeScript](https://github.com/Microsoft/TypeScript/wiki/'this'-in-TypeScript)
1818
- [Building and publishing a module with TypeScript and Rollup.js](https://hackernoon.com/building-and-publishing-a-module-with-typescript-and-rollup-js-faa778c85396)
1919
- [Debugging with TypeScript, Jest, ts-jest and Visual Studio Code](https://medium.com/@mtiller/debugging-with-typescript-jest-ts-jest-and-visual-studio-code-ef9ca8644132)
20+
- [JavaScript Modulo operation and the Caesar Cipher](http://www.codeavenger.com/2017/05/19/JavaScript-Modulo-operation-and-the-Caesar-Cipher.html)
2021

2122
## Geoscience
2223

README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Leaflet.Geodesic
2-
[![Build Status](https://travis-ci.org/henrythasler/Leaflet.Geodesic.svg?branch=master)](https://travis-ci.org/henrythasler/Leaflet.Geodesic) [![npm](https://img.shields.io/npm/v/leaflet.geodesic)](https://www.npmjs.com/package/leaflet.geodesic) [![Coverage Status](https://coveralls.io/repos/github/henrythasler/Leaflet.Geodesic/badge.svg?branch=master)](https://coveralls.io/github/henrythasler/Leaflet.Geodesic?branch=master) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=henrythasler_Leaflet.Geodesic&metric=alert_status)](https://sonarcloud.io/dashboard?id=henrythasler_Leaflet.Geodesic) [![Total alerts](https://img.shields.io/lgtm/alerts/g/henrythasler/Leaflet.Geodesic.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/henrythasler/Leaflet.Geodesic/alerts/) [![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/henrythasler/Leaflet.Geodesic.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/henrythasler/Leaflet.Geodesic/context:javascript)
2+
[![Build Status](https://travis-ci.org/henrythasler/Leaflet.Geodesic.svg?branch=master)](https://travis-ci.org/henrythasler/Leaflet.Geodesic) [![npm](https://img.shields.io/npm/v/leaflet.geodesic)](https://www.npmjs.com/package/leaflet.geodesic) [![Coverage Status](https://coveralls.io/repos/github/henrythasler/Leaflet.Geodesic/badge.svg?branch=master)](https://coveralls.io/github/henrythasler/Leaflet.Geodesic?branch=master) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=henrythasler_Leaflet.Geodesic&metric=alert_status)](https://sonarcloud.io/dashboard?id=henrythasler_Leaflet.Geodesic)
33

4-
Add-on for [Leaflet](http://leafletjs.com/) to draw [geodesic](http://en.wikipedia.org/wiki/Geodesics_on_an_ellipsoid) lines and circles. A geodesic line is the shortest path between two given positions on the earth surface. It uses [Vincenty's formulae](https://en.wikipedia.org/wiki/Vincenty%27s_formulae) for highest precision.
4+
Add-on for [Leaflet](http://leafletjs.com/) to draw [geodesic](http://en.wikipedia.org/wiki/Geodesics_on_an_ellipsoid) lines and circles. A geodesic line is the shortest path between two given positions on the earth surface. It's based on [Vincenty's formulae](https://en.wikipedia.org/wiki/Vincenty%27s_formulae) implemented by [Chris Veness](https://github.com/chrisveness/geodesy) for highest precision.
55

66
[![demo](docs/img/demo.png)](https://blog.cyclemap.link/Leaflet.Geodesic/basic-interactive.html)
77

@@ -18,7 +18,9 @@ Leaflet.Geodesic is available via CDN. Add the following snippet to your html-fi
1818
<script src="https://cdn.jsdelivr.net/npm/leaflet.geodesic"></script>
1919
```
2020

21-
Leaflet.Geodesic is available from [unpkg](https://unpkg.com/browse/leaflet.geodesic/) and [jsDelivr](https://www.jsdelivr.com/package/npm/leaflet.geodesic).
21+
Leaflet.Geodesic is available from [unpkg](https://unpkg.com/browse/leaflet.geodesic/), [jsDelivr](https://www.jsdelivr.com/package/npm/leaflet.geodesic) and [npmjs](https://www.npmjs.com/package/leaflet.geodesic).
22+
23+
Add it in your nodejs-project with `npm i leaflet.geodesic`.
2224

2325
## Basic usage
2426

@@ -166,11 +168,17 @@ const geodesic = new L.Geodesic([Berlin, LosAngeles]).addTo(map); // add empty
166168
geodesic.addLatLng(Beijing)
167169
```
168170

169-
The new point will always be added to the last linestring of a multiline. You can define a specific linestring to add to by reading the `points` property before and hand ofer a specific linestring as second parameter:
171+
The new point will always be added to the last linestring of a multiline. You can define a specific linestring to add to by reading the `points` property before and hand over a specific linestring as second parameter:
170172

171173
```Javascript
172-
const geodesic = new GeodesicLine([[Berlin, LosAngeles], [Santiago, Capetown]]).addTo(map);
173-
line.addLatLng(Beijing, line.points[0]); // results in [[Berlin, LosAngeles, Beijing], [Santiago, Capetown]]
174+
const Berlin = new L.LatLng(52.5, 13.35);
175+
const LosAngeles = new L.LatLng(33.82, -118.38);
176+
const Beijing = new L.LatLng(39.92, 116.39 );
177+
const Capetown = new L.LatLng(-33.94, 18.39 );
178+
const Santiago = new L.LatLng(-33.44, -70.71);
179+
180+
const geodesic = new L.Geodesic([[Berlin, LosAngeles], [Santiago, Capetown]]).addTo(map);
181+
geodesic.addLatLng(Beijing, geodesic.points[0]); // results in [[Berlin, LosAngeles, Beijing], [Santiago, Capetown]]
174182
```
175183

176184
### Line Options

docs/api/assets/js/search.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)