No description, website, or topics provided.
JavaScript
Latest commit 2e31ea3 Dec 11, 2014 Nathan Mahdavi minify
Permalink
Failed to load latest commit information.
dist minify Dec 11, 2014
examples add readonly toggle button in example May 15, 2014
src Now unbinds map click correctly Dec 10, 2014
LICENSE initial commit Nov 20, 2013
README.md update readme with demo url May 16, 2014

README.md

Leaflet Plotter

Demo

http://scripter-co.github.io/leaflet-plotter/

Overview

example

leaflet-plotter allows you to create routes using a leaflet powered map. You can click on the mid-points to create a new, draggable point.

Creating a plotted polyline

var plottedPolyline = L.Polyline.Plotter([
    [51.53662, -0.09218],
    [51.54281, -0.10712],
    [51.5394, -0.12394],
    [51.53246, -0.12772],
    [51.50735, -0.09253],
    [51.53085, -0.0563],
    [51.53865, -0.06008],
    [51.54164, -0.07502],
    [51.53662, -0.08875]
],{
    weight: 5
}).addTo(map);

Getting plotted points

plottedPolyline.getLatLngs();

Read only plot

default: false

With the plotter, you can create a plot with the options when initializing:

var plottedPolyline = L.Polyline.Plotter([
    [51.53662, -0.09218]
],{
    weight: 5,
    readOnly: true
}).addTo(map);

or you can set it after the fact:

plottedPolyline.setReadOnly(true);

Licence

Copyright (c) 2013 Nathan Mahdavi

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.