Files
pcm-geocode-bundle/README.md
2024-09-26 10:41:56 +01:00

700 B

PCM Geocode Bundle

Provides an interface/trait combo to add latitude and longitude fields to an entity.

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.