Location::get - jcobban/Genealogy GitHub Wiki
$location->get($fieldname)
Up: class Location
This returns the value of the identified field. It has one parameter:
parameter | description |
---|---|
$field | The field name is case insensitive and may be a synonym defined by the derived class to facilitate readability. Late static binding is used so this method takes advantage of field name definitions in the derived class. The field name may also be a temporary field defined by assigning a value to it in the set method. This method creates a trace entry if the field name does not correspond to any field in the record and debugging is enabled. |
It overloads the base implementation as follows:
field name | description |
---|---|
'latitude' | Returns the value as a floating point number in degrees. |
'longitude' | Returns the value as a floating point number in degrees. |
'boundary' | The latitude and longitude values from the database record are displayed with only 6 digits after the decimal point. If there is more than one polygon/polyline in the object, the value is returned as an array of strings. |
'county' | County name. If the value of 'location' is of a form "..., $name, SS, CC" where new County(array('domain' => "CCSS", 'name' => $name)->isExisting() is true then field 'county' is set to $name. |
'searchname' | Geo-location search name. This is constructed from 'location' to create a value which optimizes the Google Maps™ geolocation algorithm. In particular Google Maps™ does not, as of 2020, interpret rural property descriptions and only includes county names as part of the search if they are explicitly identified as county names by the insertion of " county" after the name of the county. |
'strokeColor' |
The color name or hexadecimal encoding to be used for drawing the line or the outside of an area. See Web Colors for details. |
'strokeWeight' |
The width, in pixels, to be used for drawing the line or the outside of an area |
'strokeOpacity' |
The opacity, between 0 and 1 to be used for drawing the line or the outside of an area |
The following are examples of how the fields 'searchname', and 'county' are constructed from the location name.
location | search name | county |
---|---|---|
Lansdowne, Leeds & Grenville, ON, CA | Lansdowne, Leeds & Grenville county, ON, CA | Leeds & Grenville |
lot 7 1RN, Mosa, Middlesex, ON, CA | Mosa, Middlesex county, ON, CA | Middlesex |
Delaware, Middlesex, ON, CA | Delaware, Middlesex county, ON, CA | Middlesex |
Middlemiss, Ekfrid, Middlesex, ON, CA | Middlemiss, Ekfrid, Middlesex county, ON, CA | Middlesex |
N ½ lot 10 1RN, Ekfrid, Middlesex, ON, CA | Ekfrid, Middlesex county, ON, CA | Middlesex |
The support for interface ArrayAccess
in the base class Record
means that the following are equivalent:
$var = $location->get($field);
$var = $location[$field];