public static function LeafletTileLayerOverlay::getOptionsForm in Geolocation Field 8.3
Return options array for tile overlay.
Parameters
string $overlay: Map tile overlay selected.
Return value
array Options form.
2 calls to LeafletTileLayerOverlay::getOptionsForm()
- LeafletTileLayerOverlay::addTileOverlaySettingsFormAjax in modules/
geolocation_leaflet/ src/ Plugin/ geolocation/ MapFeature/ LeafletTileLayerOverlay.php - Return settings array for tile overlay after select change.
- LeafletTileLayerOverlay::getSettingsForm in modules/
geolocation_leaflet/ src/ Plugin/ geolocation/ MapFeature/ LeafletTileLayerOverlay.php - Provide a generic map settings form array.
File
- modules/
geolocation_leaflet/ src/ Plugin/ geolocation/ MapFeature/ LeafletTileLayerOverlay.php, line 41
Class
- LeafletTileLayerOverlay
- Provides map tile layer overlay support.
Namespace
Drupal\geolocation_leaflet\Plugin\geolocation\MapFeatureCode
public static function getOptionsForm($overlay) {
$form = [
'#prefix' => '<div id="tile-overlay-settings">',
'#suffix' => '</div>',
];
if ($overlay == 'OpenWeatherMap') {
$form['apiKey'] = [
'#type' => 'textfield',
'#title' => t('API key'),
'#default_value' => '',
'#description' => t('Get your API Key here <a href="@url">@overlay</a>.', [
'@url' => 'https://openweathermap.org/',
'@overlay' => $overlay,
]),
];
}
return $form;
}