Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

Leaflet.MultiOptionsPolyline

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Leaflet.MultiOptionsPolyline

A Leaflet plugin for multi-colored Polyline

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
164
decreased by-30.51%
Maintainers
1
Weekly downloads
 
Created
Source

Leaflet.MultiOptionsPolyline

A Leaflet-plugin to enable multiple styles for a polyline.

Here you can see a demo.

Usage

Have a look at the demo. Links to source code are included.

Example

L.multiOptionsPolyline(points, {
    multiOptions: {
        optionIdxFn: function (latLng) {
            var i,
                altThresholds = [800, 900, 1000, 1100, 1200, 1300, 1400, 1500];

            for (i = 0; i < altThresholds.length; ++i) {
                if (latLng.alt <= altThresholds[i]) {
                    return i;
                }
            }
            return altThresholds.length;
        },
        options: [
            {color: '#0000FF'}, {color: '#0040FF'}, {color: '#0080FF'},
            {color: '#00FFB0'}, {color: '#00E000'}, {color: '#80FF00'},
            {color: '#FFFF00'}, {color: '#FFC000'}, {color: '#FF0000'}
        ]
    },
    weight: 5,
    lineCap: 'butt',
    opacity: 0.75,
    smoothFactor: 1}).addTo(map);

Installation

Bower

$ bower install hgoebl/Leaflet.MultiOptionsPolyline --save

License

MIT-License (see LICENSE file).

Keywords

FAQs

Package last updated on 27 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc