Overview

Namespaces

  • Mapbender
    • Component
      • HTTP
    • CoreBundle
      • Command
      • Component
        • Exception
      • Controller
      • DataFixtures
        • ORM
      • DependencyInjection
      • Element
        • Type
      • Entity
      • EventListener
      • Extension
      • Form
        • DataTransformer
        • EventListener
        • Type
      • Security
      • Template
    • DrupalIntegrationBundle
      • DependencyInjection
      • Security
        • Authentication
          • Provider
          • Token
        • Authorization
          • Voter
        • Factory
        • Firewall
        • User
      • Session
    • KmlBundle
      • Element
    • ManagerBundle
      • Controller
      • Form
        • DataTransformer
        • Type
    • MonitoringBundle
      • Command
      • Component
      • Controller
      • DependencyInjection
      • Entity
      • EventListener
      • Form
    • PrintBundle
      • Component
      • Controller
    • WmcBundle
      • Component
        • Exception
      • Element
        • Type
      • Entity
      • Form
        • EventListener
        • Type
    • WmsBundle
      • Component
        • Exception
      • Controller
      • DependencyInjection
      • Element
        • Type
      • Entity
      • Event
      • Form
        • EventListener
        • Type
    • WmtsBundle
      • Component
        • Exception
      • Controller
      • Entity
      • Form
        • Type
  • None
  • PHP

Classes

  • AboutDialogAdminType
  • ActivityIndicatorAdminType
  • ButtonAdminType
  • CoordinatesDisplayAdminType
  • CopyrightAdminType
  • FeatureInfoAdminType
  • GpsPositionAdminType
  • LayertreeAdminType
  • LegendAdminType
  • MapAdminType
  • OverviewAdminType
  • PrintClientAdminType
  • PrintClientQualityAdminType
  • PrintClientTemplateAdminType
  • RulerAdminType
  • ScaleBarAdminType
  • ScaleDisplayAdminType
  • ScaleSelectorAdminType
  • SearchRouterFormType
  • SearchRouterSelectType
  • SrsSelectorAdminType
  • TargetElementType
  • ZoomBarAdminType
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
  • Download
  1: <?php
  2: 
  3: namespace Mapbender\CoreBundle\Element\Type;
  4: 
  5: use Symfony\Component\Form\AbstractType;
  6: use Symfony\Component\Form\FormBuilderInterface;
  7: use Symfony\Component\OptionsResolver\OptionsResolverInterface;
  8: use Mapbender\CoreBundle\Form\Type\ExtentType;
  9: use Mapbender\CoreBundle\Entity\Layerset;
 10: use Mapbender\CoreBundle\Element\DataTranformer\LayersetNameTranformer;
 11: use Mapbender\CoreBundle\Form\EventListener\MapFieldSubscriber;
 12: 
 13: /**
 14:  * 
 15:  */
 16: class MapAdminType extends AbstractType
 17: {
 18: 
 19:     /**
 20:      * @inheritdoc
 21:      */
 22:     public function getName()
 23:     {
 24:         return 'map';
 25:     }
 26: 
 27:     /**
 28:      * @inheritdoc
 29:      */
 30:     public function setDefaultOptions(OptionsResolverInterface $resolver)
 31:     {
 32:         $resolver->setDefaults(array(
 33:             'application' => null,
 34:             'available_templates' => array()));
 35:     }
 36: 
 37:     /**
 38:      * @inheritdoc
 39:      */
 40:     public function buildForm(FormBuilderInterface $builder, array $options)
 41:     {
 42:         $subscriber = new MapFieldSubscriber($builder->getFormFactory());
 43:         $builder->addEventSubscriber($subscriber);
 44:         $app = $options['application'];
 45:         $layersets = array();
 46:         foreach($app->getLayersets() as $layerset)
 47:         {
 48:             $layersets[$layerset->getId()] = $layerset->getTitle();
 49:         }
 50: 
 51:         $builder->add('layerset', 'choice',
 52:                       array(
 53:                     'label' => 'Layerset',
 54:                     "required" => true,
 55:                     'choices' => $layersets))
 56:                 ->add('dpi', 'text',
 57:                       array(
 58:                     'label' => 'DPI'
 59:                 ))
 60:                 ->add('srs', 'text',
 61:                       array(
 62:                     'label' => 'SRS'
 63:                 ))
 64:                 ->add('units', 'choice',
 65:                       array(
 66:                     'label' => 'Map units',
 67:                     'choices' => array(
 68:                         'degrees' => 'Degrees',
 69:                         'm' => 'Meters',
 70:                         'ft' => 'Feet',
 71:                         'mi' => 'Miles',
 72:                         'inches' => 'Inches'
 73:                         )))
 74:                 ->add('extent_max', new ExtentType(),
 75:                       array(
 76:                     'label' => 'Max. extent',
 77:                     'property_path' => '[extents][max]'
 78:                 ))
 79:                 ->add('extent_start', new ExtentType(),
 80:                       array(
 81:                     'label' => 'Start. extent',
 82:                     'property_path' => '[extents][start]'
 83:                 ))
 84:                 ->add('scales', 'text',
 85:                       array(
 86:                     'label' => 'Scales (csv)',
 87:                     'required' => true
 88:                 ))
 89:                 ->add('maxResolution', 'text',
 90:                       array(
 91:                     'label' => 'Max. resolution'
 92:                 ))
 93:                 ->add('imgPath', 'text',
 94:                       array(
 95:                     'label' => 'OL image path'
 96:                 ))
 97:                 ->add('otherSrs', 'text',
 98:                       array(
 99:                     'label' => 'Other SRS',
100:                     'required' => false
101:                 ));
102:     }
103: 
104: }
105: 
106: 
Mapbender3 API documenation API documentation generated by ApiGen 2.8.0