protected function GeoJson::renderMainField in Views GeoJSON 8
Retrieves the main fields values.
Parameters
\Drupal\views\ResultRow $row: The result row.
string $field_name: The main field name.
Return value
string The main field value.
2 calls to GeoJson::renderMainField()
- GeoJson::renderDescriptionField in src/
Plugin/ views/ style/ GeoJson.php - Retrieves the description field value.
- GeoJson::renderNameField in src/
Plugin/ views/ style/ GeoJson.php - Retrieves the name field value.
File
- src/
Plugin/ views/ style/ GeoJson.php, line 500
Class
- GeoJson
- Style plugin to render view as GeoJSON code.
Namespace
Drupal\views_geojson\Plugin\views\styleCode
protected function renderMainField(ResultRow $row, $field_name) {
if ($this->options['data_source'][$field_name]) {
if (empty($this->view->field[$this->options['data_source'][$field_name]]->view->row_index)) {
$this->view->field[$this->options['data_source'][$field_name]]->view->row_index = $row->index;
}
return $this->view->field[$this->options['data_source'][$field_name]]
->advancedRender($row);
}
return '';
}