{ "info": { "author": "Roger Ineichen, Projekt01 GmbH", "author_email": "dev@projekt01.ch", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Zope3", "Intended Audience :: Developers", "License :: OSI Approved :: Zope Public License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP" ], "description": "This package provides a m01.mongo and z3c.form based google map widget for Zope3.\n\n\n======\nREADME\n======\n\nThis package provides a z3c.form widget concept for google maps. For more info\nabout google maps see: http://code.google.com/apis/maps/.\n\n >>> import os\n >>> import zope.component\n >>> from zope.pagetemplate.interfaces import IPageTemplate\n >>> from zope.interface.verify import verifyClass\n >>> from z3c.form.interfaces import IWidget\n >>> from z3c.form.interfaces import INPUT_MODE\n >>> from z3c.form.testing import TestRequest\n >>> from z3c.form.widget import WidgetTemplateFactory\n >>> import m01.gmap\n >>> import m01.gmap.util\n >>> import m01.gmap.browser\n >>> from m01.gmap import interfaces\n >>> from m01.gmap.widget import GMapWidget\n >>> from m01.gmap.widget import GeoPointGMapWidget\n\n\nGMapWidget\n----------\n\nThe google map (GMapWidget) widget allows you to show a map for select latitude\nand longitude for a geo location in input mode. In display mode it offers a\nGMap which shows the given location.\n\nAs for all widgets, the GMap widget must provide the ``IWidget``\ninterface:\n\n >>> verifyClass(IWidget, GMapWidget)\n True\n\nThe widget can be instantiated only using the request:\n\n >>> request = TestRequest()\n >>> widget = GMapWidget(request)\n\nBefore rendering the widget, one has to set the name and id of the widget:\n\n >>> widget.id = 'widget.id'\n >>> widget.name = 'widget.name'\n\nWe also need to register the template for the widget:\n\n >>> def getPath(filename):\n ... return os.path.join(os.path.dirname(m01.gmap.__file__),\n ... filename)\n\n >>> zope.component.provideAdapter(\n ... WidgetTemplateFactory(getPath('widget_input.pt'), 'text/html'),\n ... (None, None, None, None, interfaces.IGMapWidget),\n ... IPageTemplate, name=INPUT_MODE)\n\nIf we render the widget we get a simple input element:\n\n >>> print(widget.render())\n \n \n
\n \n