Skip to content

Commit

Permalink
Add L.PM.Utils.pxRadiusToMeterRadius (#1007)
Browse files Browse the repository at this point in the history
* Add `L.PM.Utils.pxRadiusToMeterRadius`

* Change TypeScript comments

* Replace lines with new function
  • Loading branch information
Falke-Design authored Oct 16, 2021
1 parent 52b28ec commit c6a1a8d
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 89 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1061,12 +1061,13 @@ The following events are available on a map instance:

The following methods are available on `L.PM.Utils`:

| Method | Returns | Description |
| :------------------------------------------------------------ | :-------- | :----------------------------------------------------------------------------------------------------------- |
| calcMiddleLatLng(`map`, `latlng1`, `latlng2`) | `LatLng` | Returns the middle LatLng between two LatLngs. |
| getTranslation(`path`) | `String` | Returns the translation of the passed `path`. path = json-string f.ex. `tooltips.placeMarker`. |
| findLayers(`map`) | `Array` | Returns all layers that are available for Leaflet-Geoman. |
| circleToPolygon(`circle`, `sides = 60`, `withBearing = true`) | `Polygon` | Converts a circle into a polygon with default 60 sides. For CRS.Simple maps `withBearing` needs to be false. |
| Method | Returns | Description |
| :------------------------------------------------------------ | :-------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------- |
| calcMiddleLatLng(`map`, `latlng1`, `latlng2`) | `LatLng` | Returns the middle LatLng between two LatLngs. |
| getTranslation(`path`) | `String` | Returns the translation of the passed `path`. path = json-string f.ex. `tooltips.placeMarker`. |
| findLayers(`map`) | `Array` | Returns all layers that are available for Leaflet-Geoman. |
| circleToPolygon(`circle`, `sides = 60`, `withBearing = true`) | `Polygon` | Converts a circle into a polygon with default 60 sides. For CRS.Simple maps `withBearing` needs to be false. |
| pxRadiusToMeterRadius(`radiusInPx`, `map`, `center`) | `Number` | Converts a px-radius (CircleMarker) to meter-radius (Circle). The center LatLng is needed because the earth has different projections on different places. |

### Keyboard

Expand Down
Loading

0 comments on commit c6a1a8d

Please sign in to comment.