GeoStyleManager
---------------

Make a topic in our folder

    >>> portal = layer['portal']
    >>> from plone.app.testing import TEST_USER_ID, TEST_USER_NAME
    >>> from plone.app.testing import login, setRoles
    >>> setRoles(portal, TEST_USER_ID, ['Manager'])
    >>> login(portal, TEST_USER_NAME)

self.setRoles(('Manager',))

    >>> topic_pt = portal.portal_types['Topic']
    >>> topic_pt.global_allow = True
    >>> oid = portal.invokeFactory('Topic', 'topic')
    >>> topic = portal[oid]
    >>> c = topic.addCriterion('getGeometry', 'ATBooleanCriterion')

Add geo-styled content

    >>> oid = portal.invokeFactory('Document', 'doc')
    >>> doc = portal[oid]
    >>> from collective.geo.geographer.interfaces import IGeoreferenceable
    >>> from zope.interface import alsoProvides
    >>> alsoProvides(doc, IGeoreferenceable)

Set geo style parameters to the content type

    >>> from collective.geo.settings.interfaces import IGeoCustomFeatureStyle
    >>> geostyles = IGeoCustomFeatureStyle(doc)
    >>> geostyles.setStyles([('use_custom_styles', True),
    ...                      ('map_width', u'123px'),
    ...                      ('map_height', u'50%'),
    ...                      ('marker_image', u'string:marker.png'),
    ...                      ('marker_image_size', 0.4),
    ...                      ('linewidth', 2.1),
    ...                      ('linecolor', u'cccccc3c'),
    ...                      ('polygoncolor', u'f0f0f03c'),
    ...                      ('display_properties', ['Type','Subjects'])])

Check the topic

    >>> brain = [b for b in topic.queryCatalog() if b.id == 'doc'][0]
    >>> styles_metadata = brain.collective_geo_styles
    >>> styles_metadata['use_custom_styles']
    True
    >>> styles_metadata['map_width'] == u'123px'
    True
    >>> styles_metadata['map_height'] == u'50%'
    True
    >>> styles_metadata['marker_image'] == u'string:marker.png'
    True
    >>> styles_metadata['marker_image_size'] == 0.4
    True
    >>> styles_metadata['linewidth'] == 2.1
    True
    >>> styles_metadata['linecolor'] == u'cccccc3c'
    True
    >>> styles_metadata['polygoncolor'] ==  u'f0f0f03c'
    True
    >>> styles_metadata['display_properties'] ==  ['Type','Subjects']
    True
    >>> styles_metadata['map_viewlet_position'] == u'plone.abovecontentbody'
    True
