Skip to content

Extension points

phil/geo-bundle

What an application configures, replaces, decorates or listens to. The ports and value types are phil/geo's.

Geocoding

PointHow
The providers, in the order they are askedgeocoding.providers and each provider's keys; several make a ChainGeocoder — see Geocoding
Answers kept a whilegeocoding.cache.pool and lifetime: a CachedGeocoder around the chain
The IP locatorip_locator.maxmind or ip_locator.ipstack; MaxMind wins when both are configured
ServiceHow an application relies on it
Phil\Geo\Geocoding\GeocoderInjected wherever addresses are geocoded; an alias of the provider, the chain or the cache. An application with a provider not shipped registers a Geocoder of its own — a ChainGeocoder over it and the configured phil_geo.geocoder.<provider> services, say — and points the alias at it
Phil\Geo\Geocoding\IpLocatorInjected to locate a visitor roughly; replaced by the application's own the same way
phil_geo.geocoder.<provider>One service per provider configured, for an application that composes them itself

Forms and storage

PointHow
Where a position is keptPhil\Geo\Coordinates as an embeddable of two columns, mapped while doctrine_mapping is on; false for a mapping of the application's own — see Doctrine
More than the field doesA form type extension of the application's on CoordinatesType — see Forms

Twig and the browser

geo_attributes() writes data-latitude and data-longitude, blurred to the decimals asked for; the Stimulus controller phil--geo-bundle--distance-sort reads them on its item targets, takes latitude, longitude, locate, system and locale values, and dispatches sorted, with the origin, and denied when the browser gives no position — see Sorting by distance. The functions of distance.js — distance(), sortByDistance(), formatDistance(), positionOf() — are exported for an application's own controllers.