Skip to content

rowanwins/leaflet-pinnacle-marker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

leaflet-pinnacle-marker

Extends L.Path to create a pinnacle style marker.

Check out the demo

Installing

npm install leaflet-pinnacleMarker

Usage

Include the library after you've included leafletjs.

    require('leaflet-pinnacle-marker')
    // or
    <script src="leaflet-pinnacle-marker/dist/leaflet-pinnacle-marker.min.js"></script>
    // or via CDN
    <script src="https://unpkg.com/leaflet-pinnacle-marker"></script>

Options

width - the base width of the pinnacle (in pixels)

height - the height of the pinnacle (in pixels)

All other options related to styling, such as color and weight can be inherited from L.Path

    L.pinnacleMarker([0,0], {
        width: 8,
        height: 20,
        color: '#6e7479'
    }).addTo(map);

    // or with geojson
    L.geoJSON(data, {
        pointToLayer: function(feature, latlng) {
            return L.pinnacleMarker(latlng, {
              height: someCacluatedFunction(feature.properties.cases)
            });
            }
        }
    })

Methods

setWidth - sets the width of the base of the pinnacle

setHeight - sets the height of the pinnacle

For example

    const pm = L.pinnacleMarker([0,0]).addTo(map);
    pm.setHeight(40)

About

A plugin for leafletjs to create a pinnacle style marker.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages