From 68a2b5419be220efdba0e3a7f121b891dc9c2d97 Mon Sep 17 00:00:00 2001 From: mubashiralisiddiqui Date: Wed, 10 Feb 2021 15:50:55 +0500 Subject: [PATCH 1/2] fix typo in readme add example to use options --- README.md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 73302de..a501446 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ Leaflet.MousePosition is a simple mouse position control that you can drop into ![Screenshot](/screenshot/sample.png?raw=true) ## Using the Mouse Position Control - Insert the following line: ... @@ -20,7 +19,7 @@ These are the available options: `separator:` To separate longitude\latitude values. Defaults to ' : ' -`emptystring:` Initial text to display. Defaults to 'Unavailable' +`emptyString:` Initial text to display. Defaults to 'Unavailable' `numDigits:` Number of digits. Defaults to 5 @@ -35,7 +34,22 @@ These are the available options: `wrapLng:` Controls if longitude values will be [wrapped](https://leafletjs.com/reference-1.5.0.html#latlng-wrap). Defaults to true. `formatter:` A custom function to format the entire value. Arguments: numerical longitude value, numerical latitude value. Return value: formatted string. - Defaults to undefined. If defined will ignore: `lngFirst`, `lngFormatter`, `latFormatter` and `prefix`. +Defaults to undefined. If defined will ignore: `lngFirst`, `lngFormatter`, `latFormatter` and `prefix`. + +### e.g + +const options = { +position:'bottomleft', +separator: ':', +emptyString: 'default', +numDigits:5, +lngFirst:false, +lngFormatter: (num) => "Lng " + L.Util.formatNum(num, 3) + 'º ', +latFormatter: (num) => "Lat " + L.Util.formatNum(num, 3) + 'º ', +prefix:'', +wrapLng:true, +} +L.control.mousePosition(options).addTo(map); ## Public Methods: @@ -51,3 +65,4 @@ MIT License (MIT) [npm-image]: https://badge.fury.io/js/leaflet-mouse-position.svg [npm-url]: https://www.npmjs.com/package/leaflet-mouse-position [npm-downloads-image]: https://img.shields.io/npm/dt/leaflet-mouse-position.svg + From 222c3627fcd6d64b95a906221e7825582dc9536a Mon Sep 17 00:00:00 2001 From: mubashiralisiddiqui Date: Wed, 10 Feb 2021 15:59:38 +0500 Subject: [PATCH 2/2] indent readme --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a501446..ff61079 100644 --- a/README.md +++ b/README.md @@ -38,18 +38,18 @@ Defaults to undefined. If defined will ignore: `lngFirst`, `lngFormatter`, `latF ### e.g -const options = { -position:'bottomleft', -separator: ':', -emptyString: 'default', -numDigits:5, -lngFirst:false, -lngFormatter: (num) => "Lng " + L.Util.formatNum(num, 3) + 'º ', -latFormatter: (num) => "Lat " + L.Util.formatNum(num, 3) + 'º ', -prefix:'', -wrapLng:true, -} -L.control.mousePosition(options).addTo(map); +const options = { +position:'bottomleft', +separator: ':', +emptyString: 'default', +numDigits:5, +lngFirst:false, +lngFormatter: (num) => "Lng " + L.Util.formatNum(num, 3) + 'º ', +latFormatter: (num) => "Lat " + L.Util.formatNum(num, 3) + 'º ', +prefix:'', +wrapLng:true, +} +L.control.mousePosition(options).addTo(map); ## Public Methods: