Source code for pyams_content.component.paragraph.interfaces.map

#
# Copyright (c) 2008-2018 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'


try:
    from pyams_gis.schema import GeoPointField
except ImportError:
    GeoPointField = None
    have_gis = False
else:
    have_gis = True

if have_gis:

    # import standard library

    # import interfaces
    from pyams_content.component.paragraph.interfaces import IBaseParagraph

    # import packages
    from zope.schema import Choice, Bool

    from pyams_content import _

    #
    # Map paragraph
    #

    MAP_PARAGRAPH_TYPE = 'Map'
    MAP_PARAGRAPH_NAME = _("Location map")
    MAP_PARAGRAPH_RENDERERS = 'PyAMS.paragraph.map.renderers'


[docs] class IMapParagraph(IBaseParagraph): """Map paragraph interface""" gps_location = GeoPointField(title=_("GPS location"), description=_("GPS coordinates used to locate map"), required=False) display_marker = Bool(title=_("Display location mark?"), description=_("If 'yes', a location marker will be displayed on map"), required=True, default=True) renderer = Choice(title=_("Map template"), description=_("Presentation template used for this map"), vocabulary=MAP_PARAGRAPH_RENDERERS, default='default')