Skip to content

Leaflet PMOrtho: Adds Ortho mode (45° steps) to Polyline, Polygon and Rectangle while shift holding

Notifications You must be signed in to change notification settings

Falke-Design/PMOrtho

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leaflet PMOrtho: Adds Ortho mode (45° steps) to Polyline, Polygon and Rectangle while shift holding

This is a Leaflet Geoman Subplugin

Demo: PMOrtho

Installation

Download pmOrtho.js and include them in your project.

<script src="./dist/pmOrtho.js"></script>

or use the script over cdn:

<script src="https://cdn.jsdelivr.net/gh/Falke-Design/PMOrtho/dist/pmOrtho.js"></script>

Init PMOrtho

Add PMOrtho after Leaflet Geoman

pmOrtho = new L.PMOrtho(map)

You can set a custom key to enable ortho mode. The custom key can be event.key, event.which, event.code (https://keycode.info/)

pmOrtho = new L.PMOrtho(map, {customKey: 'b'})

Functions

Options

pmOrtho.setOptions(options)

allowOrtho: true | false
customKey: event.key | event.which | event.code
snapAngle: 45
baseAngleOfLastSegment: false
showAngleTooltip: true
angleText: "Angle: "

About

Leaflet PMOrtho: Adds Ortho mode (45° steps) to Polyline, Polygon and Rectangle while shift holding

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published