openlayers-8.x-4.x-dev/src/Plugin/Source/MapQuest/MapQuest.php
src/Plugin/Source/MapQuest/MapQuest.php
<?php
namespace Drupal\openlayers\Plugin\Source\MapQuest;
use Drupal\Core\Form\FormStateInterface;
use Drupal\openlayers\Types\Source;
/**
* FIX - Insert short comment here.
*
* @OpenlayersPlugin(
* id = "ol_source_mapquest",
* label = @Translation("MapQuest"),
* description = @Translation("TODO..."),
* service = "openlayers.Source:MapQuest",
* library = "openlayers-plugin-source-mapquest",
* is_configurable = "true",
* type = "source"
* )
*/
class MapQuest extends Source {
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
// public function optionsForm(array &$form, array &$form_state) {
$layer_types = array(
'osm' => 'OpenStreetMap',
'sat' => 'Satellite',
'hyb' => 'Hybrid',
);
$form['options']['layer'] = array(
'#title' => t('Source type'),
'#type' => 'select',
'#default_value' => $this->getOption('layer', 'osm'),
'#options' => $layer_types,
);
}
}
