Giter Site home page Giter Site logo

leaflet.arc's Introduction

Leaflet.js plugin for drawing Great Circle arcs using arc.js

This plugin adds L.Polyline.Arc function which wraps arc.js functionality for creation of Great Cirlce arcs.

Tested with Leaflet v1.0.0-beta.2

Demo

Usage

Include Leaflet.js, arc.js and Leaflet.Arc.min.js:

<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v1.0.0-beta.2/leaflet.css"/>
<script src="http://cdn.leafletjs.com/leaflet/v1.0.0-beta.2/leaflet.js"></script>
<script src='http://api.mapbox.com/mapbox.js/plugins/arc.js/v0.1.0/arc.js'></script>
<script src='Leaflet.Arc.min.js'></script>

or install with npm:

npm install --save https://github.com/MAD-GooZe/Leaflet.Arc.git#gh-pages

Create arcs!

 L.Polyline.Arc([43.11667, 131.90000], [55.7522200, 37.6155600]).addTo(map);

You can also change number of vertices in line or use all L.Polyline options:

 L.Polyline.Arc([59.56667, 150.80000], [67.50000, 64.03333], {
    color: "red",
    vertices: 200
}).addTo(map);

API

L.Polyline.Arc(from, to, options)

Returns general L.Polyline object.

from, to

L.latLng objects representing the beginning and the end of arc options

options

Optional object to declare options. Possible properties (inherited from arc.js options):

  • vertices - number of intermediate vertices in resulting arc;
  • offset - controls the likelyhood that lines will be split which cross the dateline

All L.Polyline options are also supported.

leaflet.arc's People

Contributors

mad-gooze avatar amaldare93 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.