Skip to content
Snippets Groups Projects
Commit 09b96fcd authored by Christian Adamski's avatar Christian Adamski
Browse files

Issue #3519394: Make current location indicator icon configurable

parent 7995e77b
Branches
No related tags found
1 merge request!97Issue #3519394: Make current location indicator icon configurable
Pipeline #497783 passed
......@@ -3,6 +3,7 @@
namespace Drupal\geolocation\Plugin\geolocation\MapFeature;
use Drupal\geolocation\MapFeatureBase;
use Drupal\geolocation\MapProviderInterface;
/**
* Redraw locations as shapes.
......@@ -26,4 +27,31 @@ class ClientLocationIndicator extends MapFeatureBase {
return $settings;
}
/**
* {@inheritdoc}
*/
public function getSettingsForm(array $settings, array $parents = [], ?MapProviderInterface $mapProvider = NULL): array {
$form = parent::getSettingsForm($settings, $parents, $mapProvider);
$form['icon_path'] = [
'#type' => 'textfield',
'#title' => $this->t('Icon path'),
'#default_value' => $settings['icon_path'],
'#description' => $this->t('Path to icon. Empty to default.'),
];
return $form;
}
/**
* {@inheritdoc}
*/
public function getSettings(array $settings, ?MapProviderInterface $mapProvider = NULL): array {
$settings = parent::getSettings($settings, $mapProvider);
$settings['icon_path'] = $settings['icon_path'] ?: self::getDefaultSettings()['icon_path'];
return $settings;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment