This class contains methods for geometry operations requiring call to Leaflet functions
See theGeometry for the one and only one instance of this class
Add two points
| Name | Type | Description |
|---|---|---|
| point1 | Array of Number | The first point to add |
| point2 | Array of Number | The second point to add |
This method search the nearest point on a route from a given point and compute the distance between the beginning of the route and the nearest point
| Name | Type | Description |
|---|---|---|
| route | Route | The route object to be used |
| latLng | Array of Number | The latitude and longitude of the point |
This method build a LeafletLatLngBounds object from an array of points
| Name | Type | Description |
|---|---|---|
| latLngs | Array of Array of Number | The array of latitude and longitude |
Compute the latitude, longitude, elevation, ascent and distance of a point on a route when only the distance between the beginning of the route and the point is know
| Name | Type | Description |
|---|---|---|
| route | Route | The route |
| distance | Number | The distance (units: meter) |
This method returns a LeafletLatLngBounds that represents a square
| Name | Type | Description |
|---|---|---|
| latLngCenter | Array of Number | The latitude and longitude of the center of the square |
| dimension | Number | The half length of the square side in meter. |
This method transforms a lat lng coordinate to pixel coordinate relative to the CRS origin using the Leaflet method map.project
| Name | Type | Description |
|---|---|---|
| latLng | Array of Number | The latitude and longitude of the point |
| zoom | Number | The zoom factor to use |
Transform a screen coordinate to a latLng using the Leaflet map.containerPointToLatLng method
| Name | Type | Description |
|---|---|---|
| xScreen | Number | The x screen coordinate |
| yScreen | Number | The y screen coordinate |
Subtrack two points
| Name | Type | Description |
|---|---|---|
| point1 | Array of Number | The first point |
| point2 | Array of Number | The point to subtrack |
Simple constant for computation