function updateCMSFields(FieldList $fields) { if ($this->classHasGoogleMap()) { $fields->addFieldToTab("Root", new Tab("Map")); $fields->addFieldToTab("Root.Map", new CheckboxField("HasGeoInfo", "Has Address(es)? - save and reload this page to start data-entry")); if ($this->owner->HasGeoInfo) { $dataObject = new GoogleMapLocationsObject(); $complexTableFields = $dataObject->complexTableFields(); $source = $this->owner->GeoPoints(); $GeoPointsField = new GridField("GeoPoints", "Locations", $source, GridFieldConfig_RelationEditor::create()); $fields->addFieldToTab("Root.Map", $GeoPointsField); } } return $fields; }