@@ -35,15 +35,14 @@ public function __construct(DataObject $data, $title, $options = array()) {
35
35
36
36
// Create the latitude/longitude hidden fields
37
37
$ this ->children = new FieldList (
38
- $ this ->latField = HiddenField::create ($ name. ' [Latitude ] ' , 'Lat ' , $ this ->getLatData ())->addExtraClass ('googlemapfield-latfield ' ),
39
- $ this ->lngField = HiddenField::create ($ name. ' [Longitude] ' , 'Lng ' , $ this ->getLngData ())->addExtraClass ('googlemapfield-lngfield ' ),
38
+ $ this ->latField = HiddenField::create ($ name . ' [ ' . $ fieldNames [ ' lat ' ] . ' ] ' , 'Lat ' , $ this ->getLatData ())->addExtraClass ('googlemapfield-latfield ' ),
39
+ $ this ->lngField = HiddenField::create ($ name . ' [ ' . $ fieldNames [ ' lng ' ] . ' ] ' , 'Lng ' , $ this ->getLngData ())->addExtraClass ('googlemapfield-lngfield ' ),
40
40
TextField::create ('Search ' )
41
41
->addExtraClass ('googlemapfield-searchfield ' )
42
42
->setAttribute ('placeholder ' , 'Search for a location ' )
43
43
);
44
44
45
45
parent ::__construct ($ name , $ title );
46
-
47
46
}
48
47
49
48
public function Field ($ properties = array ()) {
@@ -57,6 +56,7 @@ public function Field($properties = array()) {
57
56
'mapTypeId ' => 'ROADMAP ' ,
58
57
),
59
58
);
59
+
60
60
$ jsOptions = array_merge ($ jsOptions , $ this ->options );
61
61
$ this ->setAttribute ('data-settings ' , Convert::array2json ($ jsOptions ));
62
62
return parent ::Field ($ properties );
0 commit comments