1.0.2releasedField: Geocoding
Populates fields with geocoding information using the combined values of other fields.
Clone URLhttps://github.com/twiro/geocodingfield.git
Add as a submodulegit submodule add https://github.com/twiro/geocodingfield.git extensions/geocodingfield --recursive
Compatibility
2.x.x | 2.1.x | 2.2.x | 2.3.x | 2.4.x | 2.5.x | 2.6.x | 2.7.0 | 2.7.1 | 2.7.2 | 2.7.3 | 2.7.4 | 2.7.5 | 2.7.6 | 2.7.7 | 2.7.8 | 2.7.9 | 2.7.10 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
No | No | 0.7 | 1.0.2 | 1.0.2 | 1.0.2 | 1.0.2 | No | No | No | No | No | No | No | No | No | No | No. Soon? |
Readme
Geocoding Field
A Symphony CMS extension that populates fields with geocoding information using the combined values of other fields.
Installation
- Upload the 'geocodingfield' folder in this archive to your Symphony 'extensions' folder.
- Enable it by selecting the "Field: Geocoding", choose Enable from the with-selected menu, then click Apply.
- You can now add the "Geocoding" field to your sections.
Configuration
In the field settings you define an XPath to create a new value from the XML data of other fields which then gets geocoded.
For example, if you have a section with two fields "Country" and "City", you could use the Geocoding Field to get the location by setting its expression to {entry/country}, {entry/city}
.
Data Source Filtering
The field provides a single syntax for radius-based searches. Use the following as a DS filter:
within DISTANCE UNIT of ORIGIN
DISTANCE
is an integerUNIT
is the distance unit:km
,mile
ormiles
ORIGIN
is the centre of the radius. Accepts either a latitude/longitude pair or an address
Examples:
within 20 km of 10.545,-103.1
within 1km of 1 West Street, Burleigh Heads, Australia
within 500 miles of London
To make the filters dynamic, use the parameter syntax like any other filter. For example using querystring parameters:
within {$url-distance} {$url-unit} of {$url-origin}
Attached to a page invoked as:
/?distance=30&unit=km&origin=London,England
Data Source XML result
The XML output of the field looks like this:
<location latitude="51.6614" longitude="-0.40042"/>
The two attributes are the latitude/longitude of the location.
If you are filtering using the Geocoding Field using a "within" filter then you will see an additional <distance>
element:
<location latitude="51.6614" longitude="-0.40042">
<distance from="51.6245572,-0.4674079" distance="3.8" unit="miles" />
</location>
The from
attribute is the latitude/longitude resolved from the DS filter (the origin), the unit
shows either "km" or "miles" depending on what you use in your filter, and distance
is the distance between your map marker and the origin.
Credits
This extensions is heavily based on the Reflection Field and the Map Location Field.
Version history
Symphony 2.3.0 to 2.6.x
- Updated field label to follow Symphony core field structure by using
<label<
instead of<p<
.
Requires Symphony 2.3.0
- Use Geocoding API (V3)
Requires Symphony 2.3.0
- Symphony 2.3 compatibility
- Show map of location in entry table and publish panel
- Add distance to datasource XML output when the field is used as a filter
Requires Symphony 2.2.0