Skip to content

Allows to show length information for the length of each of the sides of a polygon as well as the area.

License

Notifications You must be signed in to change notification settings

kartena/Leaflet.PolySideLabel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Label for the polygon sides (L.PolySideLabel)

This class will show the distance between each of the vertices of the polygon/polyline when the mouse is on top of it. It works great for most browsers, except for IE7/8 where on hover, it shows the info for all the polygones at the same time (and not only the one you are hovering over).

Notes

  • There is a limit of sides (option bodersLimit = 8) which you can change. This limit sets the max amount of sides for a polygon to show the length info. If is greater, then nothing is shown.
  • If the sides are too small (option minSideLength 40 meters), then instead of the distance, you will get characters and a leyend on the side indicating the sides for each character.
  • There is a limit for the visible area (option minAreaToShow). If the visible drawn area is smaller than this, the info wil not be shown.

Code example:

    var polygon = new L.Polygon(...);
    ....
    map.addLayer(polygon);
    var labelPolygon = new L.PolySideLabel(polygon, options);

About

Allows to show length information for the length of each of the sides of a polygon as well as the area.

Resources

License

Stars

Watchers

Forks

Packages

No packages published