Update changelog and readme

This commit is contained in:
2024-09-26 10:41:56 +01:00
parent 412c4eb579
commit 9246f74117
2 changed files with 9 additions and 1 deletions

View File

@@ -1,6 +1,8 @@
# Changelog # Changelog
## [x.x.x] xxxx-xx-xx ## [x.x.x] xxxx-xx-xx
- Adjust how error messages are formatted
- Add getGeocodeData method to GeocodeInterface to allow for more abstraction in services
- Coordinates set to 0, 0 will cause isGeocoded to return false - Coordinates set to 0, 0 will cause isGeocoded to return false
## [1.0.0] 2024-08-05 ## [1.0.0] 2024-08-05

View File

@@ -2,5 +2,11 @@
Provides an interface/trait combo to add latitude and longitude fields to an entity. Provides an interface/trait combo to add latitude and longitude fields to an entity.
Also included is a `Geocoder` service which accepts a postcode and attempts to return a `GeoCoordinates` object which contains the latitude and longitude of the postcode. Also included is a `Geocoder` service which accepts an instance of GeocodeInterface and attempts to return a `GeoCoordinates` object which contains the object's latitude and longitude.
# Usage
Use the `GeocodeTrait` an an entity to give it latitude and longitude fields.
If you wish to geocode an entity you must implement the `GeocodeInterface` interface, the trait will get you most of the way there but you must manually add a `getGeocodeData()` method. The simplest implementation is to return a postcode, but you can return a string of any data if it can be used to find a location.