services:
    con4gis.layer_service:
        class: con4gis\MapsBundle\Classes\Services\LayerService
        public: true
        arguments:
            - "@event_dispatcher"
            - "@con4gis.layer_content_service"

    con4gis.profile_service:
        class: con4gis\MapsBundle\Classes\Services\ProfileService
        public: true
        arguments:
            - "@event_dispatcher"

    con4gis.baselayer_service:
        class: con4gis\MapsBundle\Classes\Services\BaseLayerService
        public: true
        arguments:
            - "@event_dispatcher"

    con4gis.layer_content_service:
        class: con4gis\MapsBundle\Classes\Services\LayerContentService
        public: true
        arguments:
            - "@con4gis.profile_service"
            - "@con4gis.layer_contentdata_service"

    con4gis.layer_contentdata_service:
        class: con4gis\MapsBundle\Classes\Services\LayerContentDataService
        public: true
        arguments:
            - "@contao.framework"

    con4gis.filter_service:
        class: con4gis\MapsBundle\Classes\Services\FilterService
        public: true
        arguments:
            - "@event_dispatcher"

    con4gis\MapsBundle\Controller\LayerController:
        class: con4gis\MapsBundle\Controller\LayerController
        public: true
        calls:
            - setContainer: ['@service_container']
        arguments:
            - "@service_container"
            - "@contao.framework"
            - "@con4gis.layer_contentdata_service"
        tags:
            - controller.service_arguments
            - container.service_subscriber

    con4gis\MapsBundle\Controller\BaselayerController:
        class: con4gis\MapsBundle\Controller\BaselayerController
        calls:
            - setContainer: [ '@service_container' ]
        public: true
        arguments:
            - "@service_container"

    con4gis\MapsBundle\Controller\LocationstyleController:
        class: con4gis\MapsBundle\Controller\LocationstyleController
        calls:
            - setContainer: [ '@service_container' ]
        public: true
        arguments:
            - "@service_container"

    con4gis\MapsBundle\Controller\MapsController:
        class: con4gis\MapsBundle\Controller\MapsController
        public: true
        calls:
            - setContainer: [ '@service_container' ]
        arguments:
            - "@service_container"
            - "@contao.framework"

    con4gis\MapsBundle\Controller\FilterController:
        class: con4gis\MapsBundle\Controller\FilterController
        public: true
        calls:
            - setContainer: [ '@service_container' ]
        arguments:
            - "@con4gis.filter_service"

    con4gis.route_service:
        class: con4gis\MapsBundle\Classes\Services\RouteService
        public: true
        arguments:
            - "@event_dispatcher"

    con4gis.area_service:
        class: con4gis\MapsBundle\Classes\Services\AreaService
        public: true
        arguments:
            - "@event_dispatcher"

    con4gis\MapsBundle\Controller\RoutingController:
        class: con4gis\MapsBundle\Controller\RoutingController
        public: true
        calls:
            - setContainer: [ '@service_container' ]
        arguments:
            - "@service_container"
            - "@contao.framework"

    ## routing
    routing.onLoadRouteFeaturesGetFeatures:
        class: con4gis\MapsBundle\Classes\Listener\LoadRouteFeaturesListener
        tags:
            - { name: kernel.event_listener, event: load.route.features, method: onLoadRouteFeaturesGetFeatures, priority: 1024 }

    routing.onLoadAreaFeaturesGetFeatures:
        class: con4gis\MapsBundle\Classes\Listener\LoadAreaFeaturesListener
        tags:
            - { name: kernel.event_listener, event: load.area.features, method: onLoadAreaFeaturesGetFeatures, priority: 1024 }
        arguments:
            - "@con4gis.area_service"

    routing.onloadMapDataAddRouterData:
        class: con4gis\MapsBundle\Classes\Listener\LoadMapDataListener
        tags:
            - { name: kernel.event_listener, event: maps.mapdata.load, method: onloadMapDataAddRouterData, priority: 1024}
        arguments:
            - "@doctrine.orm.default_entity_manager"
            - "@con4gis.layer_service"

    ## editor
    con4gis\MapsBundle\Controller\EditorController:
        class: con4gis\MapsBundle\Controller\EditorController
        public: true
        arguments:
            - "@contao.framework"