Skip to content

Commit 3e3b653

Browse files
committed
feat: userforms support
1 parent 5a1f44d commit 3e3b653

File tree

6 files changed

+621
-438
lines changed

6 files changed

+621
-438
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ silverstripe-googlemapfield
55

66
Lets you record a precise location using latitude/longitude/zoom fields to a DataObject.
77

8-
Displays a map using the Google Maps API. The user may then choose where to place the marker; the landing coordinates are then saved.
8+
Displays a map using the Google Maps API. The user may then choose where to place the marker; the landing coordinates
9+
are then saved.
910

1011
You can also search for locations using the search box, which uses the Google Maps Geocoding API.
1112

12-
Supports SilverStripe 4
13+
Supports SilverStripe 4 and Userforms
1314

1415
## Usage
1516

@@ -29,19 +30,18 @@ class Store extends DataObject
2930
'Latitude' => 'Varchar',
3031
'Longitude' => 'Varchar',
3132
];
32-
33+
3334
public function getCMSFields() {
3435
$fields = parent::getCMSFiels();
35-
36+
3637
// add the map field
3738
$fields->addFieldToTab('Root.Main', new GoogleMapField(
38-
$this,
3939
'Location'
4040
));
41-
41+
4242
// remove the lat / lng fields from the CMS
4343
$fields->removeFieldsFromTab('Root.Main', ['Latitude', 'Longitude']);
44-
44+
4545
return $fields;
4646
}
4747
}
@@ -113,4 +113,4 @@ To get a Google Maps JS API key please see [the official docs](https://developer
113113
## Geocoding access - enabling the search box
114114

115115
To use the search box to find locations on the map, you'll need to have enabled the Geocoding API as well. Please see
116-
[the official docs](https://developers.google.com/maps/documentation/javascript/geocoding#GetStarted)
116+
[the official docs](https://developers.google.com/maps/documentation/javascript/geocoding#GetStarted)

0 commit comments

Comments
 (0)