Source code for pyams_gis.interfaces.configuration

#
# Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#

__docformat__ = 'restructuredtext'


# import standard library

# import interfaces
from pyams_gis.interfaces import LAYER_CRS, LAYER_CRS_VOCABULARY, WGS84WM

# import packages
from pyams_gis.schema import GeoPointField, GeoAreaField
from zope.interface import Interface
from zope.schema import Choice, Bool, Int, List

from pyams_gis import _


[docs]class IMapConfiguration(Interface): """Map configuration interface""" crs = Choice(title=_("CRS"), description=_("Coordinates reference system to use for the map"), vocabulary=LAYER_CRS_VOCABULARY, default=LAYER_CRS[WGS84WM], required=True) layers = List(title=_("Layers list"), description=_("List of available layers displayed into this map"), value_type=Choice(vocabulary='PyAMS map layers'), required=False) attribution_control = Bool(title=_("Attribution control?"), description=_("If 'yes', an attribution control is added to map"), required=True, default=True) zoom_control = Bool(title=_("Zoom control?"), description=_("If 'yes', a zoom control is added to map"), required=True, default=True) layer_control = Bool(title=_("Layers control?"), description=_("If 'yes', a layer selection control is added to map"), required=True, default=False) initial_center = GeoPointField(title=_("Initial center"), description=_("Initial map location center"), required=False) zoom_level = Int(title=_("Initial zoom level"), description=_("Zoom level at which to display map"), min=0, max=18, required=False) initial_bounds = GeoAreaField(title=_("Initial bounds"), description=_("Initial map location bounds"), required=False) keyboard = Bool(title=_("Keyboard navigation?"), description=_("If 'yes', makes the map focusable and allows users to navigate with " "keyboard arrows and +/- keys"), required=True, default=True) scroll_wheel_zoom = Bool(title=_("Scroll wheel zoom?"), description=_("If 'yes', the map can be zoomed using the mouse wheel"), required=True, default=True) def get_configuration(self): """Get map layers configuration"""
[docs]class IMapConfigurationTarget(Interface): """Map configuration target marker interface"""