Sunnysideup\GoogleAddressField\GoogleAddressField
turns a field into a geo-coding field.
Synopsis
class GoogleAddressField
extends TextField
{
- // members
- protected bool $useSensor = false;
- protected boolean $alwaysShowFields = false;
- protected string $googleStaticMapLink = '//maps.googleapis.com/maps/api/staticmap?center=[ADDRESS]&zoom=17&scale=false&size=[MAXWIDTH]x[MAXHEIGHT]&maptype=roadmap&format=png&visual_refresh=true&markers=size:mid%7Ccolor:red%7Clabel:%7C[ADDRESS]';
- protected string $themedCssLocation = 'client/css/GoogleAddressField';
- protected array $fieldMap = ;
- protected string $typeToBeReturned = 'address';
- protected string $restrictToCountryCode = '';
- private static string $google_map_api_location = '//maps.googleapis.com/maps/api/js';
- private static string $field_js_location = 'sunnysideup/google_address_field: client/javascript/GoogleAddressField.js';
- private static array $allowed_types = ;
- private static string $api_key = '';
- // methods
- public static void js_requirements()
- public void setUseSensor()
- public void setAlwaysShowFields()
- public void setGoogleStaticMapLink()
- public void getGoogleStaticMapLink()
- public void setCssLocation()
- public void setFieldMap()
- public void addFieldMapEntry()
- public void removeFieldMapEntry()
- public void getFieldMap()
- public void setTypeToBeReturned()
- public void setRestrictToCountryCode()
- public void getRestrictToCountryCode()
- public void hasData()
- public string Field()
- public void RightTitle()
- protected string getJavascript()
Hierarchy
Extends
- SilverStripe\Forms\TextField
Members
private
- $allowed_types
- $api_key — string
- $field_js_location
- $google_map_api_location
protected
- $alwaysShowFields
- $fieldMap
—
array
list of links between form fields in the current field (e.g. TextField with name City) and the result XML. - $googleStaticMapLink
—
string
Link to the static map. Set to an empty string to have no static image appear. - $restrictToCountryCode
- $themedCssLocation
—
string
CSS file used in this field (can be themed!). - $typeToBeReturned
- $useSensor — Sunnysideup\GoogleAddressField\bool
Methods
protected
- getJavascript() — retuns the customised Javascript for the form field.
public
- Field()
- RightTitle()
- addFieldMapEntry()
- getFieldMap()
- getGoogleStaticMapLink() — get to empty string to NOT show a static map.
- getRestrictToCountryCode()
- hasData()
- js_requirements() — return a list of requirements.
- removeFieldMapEntry()
- setAlwaysShowFields()
- setCssLocation()
- setFieldMap()
- setGoogleStaticMapLink() — set to empty string to NOT show a static map.
- setRestrictToCountryCode()
- setTypeToBeReturned()
- setUseSensor() — Do you want this annoying ...