https://github.com/mestackcodes/fmx.mapsutils
It is a unit for Delphi with several complex conversion functions for working with maps and that can be used in conjunction with the TMapView Maps component.
https://github.com/mestackcodes/fmx.mapsutils
delphi fmx maps
Last synced: 9 months ago
JSON representation
It is a unit for Delphi with several complex conversion functions for working with maps and that can be used in conjunction with the TMapView Maps component.
- Host: GitHub
- URL: https://github.com/mestackcodes/fmx.mapsutils
- Owner: MEStackCodes
- License: mit
- Created: 2025-02-07T17:32:56.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-02-07T18:13:11.000Z (11 months ago)
- Last Synced: 2025-02-07T18:43:27.457Z (11 months ago)
- Topics: delphi, fmx, maps
- Language: Pascal
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FMX.MapsUtils
It is a unit for Delphi with several complex conversion functions for working with maps and that can be used in conjunction with the TMapView Maps component.
## Description
```pascal
function GooglePolylineToCoord(const Str: String; Precision: Integer): TArray;
```
It decodes a Google polyline and converts it to an array of type TMapCoordinate that can be directly manipulated by TMapView to draw a route. The precision value contains the number of decimal places in the coordinate values, the common value is 5.
##
```pascal
function GetCenterCoord(MapCoordinates: TArray): TMapCoordinate;
```
Calculates and returns the center of a route, useful for pointing the camera to the center of a polyline.
##
```pascal
function CoordinatesToFitZoom(LatitudeA, LongitudeA, LatitudeB, LongitudeB: Double): Double;
```
Returns the corresponding Zoom value to adjust the display of 2 distant points on the map, the value can be passed directly to the
TMapView component.
##
```pascal
function HaversineDistance(LatitudeA, LongitudeA, LatitudeB, LongitudeB: Double): Double;
```
Calculates the angular distance between two points on the Earth's surface. It is calculated from the longitude and latitude coordinates of each point. The result value is in meters.
## Share
If you liked and found this repository useful for your projects, star it. Thank you for your support! ⭐