Download the PHP package getkirby/geo without Composer
On this page you can find all versions of the php package getkirby/geo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package geo
Kirby GEO Plugin
This plugin adds basic geo search and conversion functionalities to Kirby
Geo Class Option
Geo::point($lat, $lng)
Creates a new Kirby Geo Point
Example:
Afterwards you can get the latitude and longitude values of the point like this:
Geo::distance($pointA, $pointB)
Returns the distance between two geo points.
You can also return the distance in miles instead of kilometers
Geo::niceDistance($pointA, $pointB)
Returns the distance between two geo points in a human readable way (i.e. 461.32 km)
You can also return the "nice distance" in miles instead of kilometers
Geo::kilometersToMiles($km)
Converts kilometers into miles:
Geo::milesToKilometers($mi)
Converts miles into kilometers:
Radius Filter
The plugin automatically adds a new filter for all collections, which can be used to do a radius search:
To make this work, the location field for each address page must be in the following format:
or with a real life example:
You can also filter in miles
Field Methods
The plugin also adds a set of field methods, which can be handy to work with locations
$field->coordinates()
Converts a field with the value format {lat},{lng} into a valid Kirby Geo Point Object:
$field->distance($point)
Calculates the distance between a location field and another Kirby Geo Point:
Of course you can run this in miles again:
$field->niceDistance($point)
Returns the distance in a more human friendly format:
What’s Kirby?
- getkirby.com – Get to know the CMS.
- Try it – Take a test ride with our online demo. Or download one of our kits to get started.
- Documentation – Read the official guide, reference and cookbook recipes.
- Issues – Report bugs and other problems.
- Feedback – You have an idea for Kirby? Share it.
- Forum – Whenever you get stuck, don't hesitate to reach out for questions and support.
- Discord – Hang out and meet the community.
- Mastodon – Spread the word.
- Instagram – Share your creations: #madewithkirby.
License
http://www.opensource.org/licenses/mit-license.php