{"id":18748211,"url":"https://github.com/benjamminf/craft-coordinates","last_synced_at":"2025-04-12T22:36:09.095Z","repository":{"id":34488746,"uuid":"38428390","full_name":"benjamminf/craft-coordinates","owner":"benjamminf","description":"A twig filter for Craft CMS that gets the latitude and longitude from an address","archived":false,"fork":false,"pushed_at":"2016-09-21T05:41:01.000Z","size":14,"stargazers_count":24,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-26T16:39:14.940Z","etag":null,"topics":["craft-plugin","craftcms","geolocation"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"facebook/create-react-app","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benjamminf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-02T11:13:02.000Z","updated_at":"2022-03-01T14:08:40.000Z","dependencies_parsed_at":"2022-09-14T10:02:10.962Z","dependency_job_id":null,"html_url":"https://github.com/benjamminf/craft-coordinates","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjamminf%2Fcraft-coordinates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjamminf%2Fcraft-coordinates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjamminf%2Fcraft-coordinates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjamminf%2Fcraft-coordinates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benjamminf","download_url":"https://codeload.github.com/benjamminf/craft-coordinates/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248642705,"owners_count":21138352,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["craft-plugin","craftcms","geolocation"],"created_at":"2024-11-07T16:34:26.554Z","updated_at":"2025-04-12T22:36:09.073Z","avatar_url":"https://github.com/benjamminf.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Coordinates\nTwig filters for Craft CMS that finds the latitude and longitude from an address.\n\nThe plugin fetches the coordinates through the Google Maps API *without* the need for an API key. Simply install the plugin and being using it.\n\n## How to use\n\n```twig\n{{ 'Flinders St, Melbourne VIC 3000' | coordinates }}\n{# Outputs '-37.8182609,144.9648863' #}\n\n{{ 'flinders STREET melbourne, Victoria, 3000' | formatAddress }}\n{# Outputs 'Flinders Street, Melbourne VIC 3000, Australia' #}\n\n{% set address = addressData('Flinders St, Melbourne VIC 3000') %}\n{{ address.coordinates }} {# Outputs '-37.8182609,144.9648863' #}\n{{ address.formattedAddress }} {# Outputs 'Flinders Street, Melbourne VIC 3000, Australia' #}\n{{ address.latitude }} {# Outputs -37.8182609 #}\n{{ address.longitude }} {# Outputs 144.9648863 #}\n{{ address.url }} {# Outputs 'https://www.google.com/maps/place/Flinders...' #}\n{% for label, part in address.parts %}\n\t{{ label }} {# Outputs 'country' | 'state' | ... #}\n\t{{ part }} {# Outputs 'Australia' | 'Victoria' | ... #}\n{% endfor %}\n```\n\n## API\n\n### Templates\n\nFilter                                           | Description\n-------------------------------------------------|------------------------------------------------------------------\n`coordinates(separator=',')` or `coords(sep...)` | Returns the latitude and longitude, separated by a custom string.\n`latitude` or `lat`                              | Returns the latitude as a number.\n`longitude` or `lng`                             | Returns the longitude as a number.\n`formatAddress`                                  | Returns a standardised address format.\n\nFunction               | Description\n-----------------------|--------------------------------------------------------------------\n`addressData(address)` | Returns a coordinates model instance from an address\n\n### CoordinatesModel\n\nTODO\n\n\n## Changelog\n\n#### v1.3.0\n- `Added` Added ability to extract parts of an address (country, state, etc.)\n- `Added` Added URL parameter to coordinates model that links an address or set of coordinates to Google Maps\n- `Fixed` Fixed name of `addressData` function\n\n#### v1.2.0\n- `Added` Added Twig functions for getting center and average coordinates for a list of coordinates\n- `Improved` `addressData()` now returns a Coordinates model rather than a plain object\n- `Improved` Refactored code and improved API\n\n#### v1.1.0\n- `Added` Added shorthand filters `lat`, `lng`, and `coords`, as well as a `addressData()` function\n- `Added` Added release feed to the plugin\n- `Improved` Improved internal caching so there is no need for `{% cache %}` tags\n- `Improved` Refactored code\n\n#### v1.0.1\n\n- `Improved` Added minor caching so that address data is only requested once per template render.\n\n#### v1.0.0\n\nInitial release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjamminf%2Fcraft-coordinates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenjamminf%2Fcraft-coordinates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjamminf%2Fcraft-coordinates/lists"}