Coder Social home page Coder Social logo

andreww2012 / l.donut Goto Github PK

View Code? Open in Web Editor NEW

This project forked from falke-design/l.donut

0.0 0.0 0.0 9 KB

A Leaflet Plugin which adds the shape L.Donut. Extension of L.Circle which allows to define a outer and inner radius.

JavaScript 84.74% HTML 15.26%

l.donut's Introduction

L.Donut

Makes it possible to draw donuts with L.Donut on Leaflet maps.

It extends L.Circle and adds a inner radius. Look into the Demo.

grafik

var donut = L.donut(map.getCenter(),{
  radius: 2000,
  innerRadius: 1000,
  innerRadiusAsPercent: false,
}).addTo(map);

Installation

Download L.Donut.js and include them in your project.

<script src="./src/L.Donut.js"></script>

or use the script over cdn:

<script src="https://cdn.jsdelivr.net/gh/Falke-Design/L.Donut@latest/src/L.Donut.js"></script>

Methods:

You can use new L.Donut or the factory L.donut.

Method Returns Description
L.donut(latlng,options) this Creates the Donut shape.
setInnerRadius(radius) this Sets the inner radius of a circle. Units are in meters or percent. The outer radius must be greater then the inner radius.
getInnerRadius() Number Returns the current inner radius of a circle. Units are in meters or percent.

Options:

Option Description
radius Outer radius. The outer radius must be greater then the inner radius.
innerRadius Inner radius. It can be a meter value or a percent (0-1) value of the outer radius.
innerRadiusAsPercent Default false. Defines if the inner radius is a percent value of the outer radius.
<L.Circle options> Other L.Circle options: Docs

l.donut's People

Contributors

diegobloise avatar falke-design 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.