With this plugin a Google-Maps FormField can be used via the FormBuilder.
Code
\wcf\system\form\builder\field\GoogleMapsFormField::create('googleMaps')
The FormField passes an array with the ID of the element to the Action class. This array contains
Code
{
"map": string,
"lat": float,
"lng": float
}
The DatabaseObject is expected to provide the following method/variable to read the value
Code
public function get{$formFieldId}GoogleMaps(): array
public function get{$formFieldId}: array
Or in the $data array an array is passed which contains the location data.
Code
{
"map": string,
"lat": float,
"lng": float
}
Only one method or the variable is required.
In order for this FormField to be used, the administrator must have entered a Google Maps API Key.
