{ "info": { "author": "akiokio", "author_email": "akio.xd@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "==================\ndjango-geoposition\n==================\n\nA model field that can hold a geoposition (latitude/longitude), and corresponding admin/form widget.\n\n.. image:: https://pypip.in/v/django-geoposition/badge.png\n :target: https://pypi.python.org/pypi/django-geoposition\n\n.. image:: https://travis-ci.org/philippbosch/django-geoposition.png?branch=master\n :target: https://travis-ci.org/philippbosch/django-geoposition\n\n\nPrerequisites\n-------------\n\nStarting with version 0.2, django-geoposition requires Django 1.4.10 or greater. If you need to support\nDjango versions prior to 1.4.10, please use django-geoposition 0.1.5.\n\n\nInstallation\n------------\n\n- Use your favorite Python packaging tool to install ``geoposition``\n from `PyPI`_, e.g.::\n\n pip install django-geoposition\n\n- Add ``\"geoposition\"`` to your ``INSTALLED_APPS`` setting::\n\n INSTALLED_APPS = (\n # \u2026\n \"geoposition\",\n )\n\n- If you are still using Django <1.3, you are advised to install\n `django-staticfiles`_ for static file serving.\n\n\nUsage\n-----\n\n``django-geoposition`` comes with a model field that makes it pretty\neasy to add a geoposition field to one of your models. To make use of\nit:\n\n- In your ``myapp/models.py``::\n\n from django.db import models\n from geoposition.fields import GeopositionField\n\n class PointOfInterest(models.Model):\n name = models.CharField(max_length=100)\n position = GeopositionField()\n\n- This enables the following simple API::\n\n >>> from myapp.models import PointOfInterest\n >>> poi = PointOfInterest.objects.get(id=1)\n >>> poi.position\n Geoposition(52.522906,13.41156)\n >>> poi.position.latitude\n 52.522906\n >>> poi.position.longitude\n 13.41156\n\n\nForm field and widget\n---------------------\n\nAdmin\n^^^^^\n\nIf you use a ``GeopositionField`` in the admin it will automatically\nshow a `Google Maps`_ widget with a marker at the currently stored\nposition. You can drag and drop the marker with the mouse and the\ncorresponding latitude and longitude fields will be updated\naccordingly.\n\nIt looks like this:\n\n|geoposition-widget-admin|\n\n\nRegular Forms\n^^^^^^^^^^^^^\n\nUsing the map widget on a regular form outside of the admin requires\njust a little more work. In your template make sure that\n\n- `jQuery`_ is included\n- the static files (JS, CSS) of the map widget are included (just use\n ``{{ form.media }}``)\n\n**Example**::\n\n \n
{% csrf_token %}\n {{ form.media }}\n {{ form.as_p }}\n
\n\n\nSettings\n--------\n\nYou can customize the `MapOptions`_ and `MarkerOptions`_ used to initialize the\nmap and marker in JavaScript by defining ``GEOPOSITION_MAP_OPTIONS`` or\n``GEOPOSITION_MARKER_OPTIONS`` in your ``settings.py``.\n\n**Example**::\n\n GEOPOSITION_MAP_OPTIONS = {\n 'minZoom': 3,\n 'maxZoom': 15,\n }\n\n GEOPOSITION_MARKER_OPTIONS = {\n 'cursor': 'move'\n }\n\nPlease note that you cannot use a value like ``new google.maps.LatLng(52.5,13.4)``\nfor a setting like ``center`` or ``position`` because that would end up as a\nstring in the JavaScript code and not be evaluated. Please use\n`Lat/Lng Object Literals`_ for that purpose, e.g. ``{'lat': 52.5, 'lng': 13.4}``.\n\nYou can also customize the height of the displayed map widget by setting\n``GEOPOSITION_MAP_WIDGET_HEIGHT`` to an integer value (default is 480).\n\n\nLicense\n-------\n\n`MIT`_\n\n\n.. _PyPI: http://pypi.python.org/pypi/django-geoposition\n.. _django-staticfiles: http://github.com/jezdez/django-staticfiles\n.. _Google Maps: http://code.google.com/apis/maps/documentation/javascript/\n.. |geoposition-widget-admin| image:: docs/images/geoposition-widget-admin.jpg\n.. _jQuery: http://jquery.com\n.. _MIT: http://philippbosch.mit-license.org/\n.. _MapOptions: https://developers.google.com/maps/documentation/javascript/reference?csw=1#MapOptions\n.. _MarkerOptions: https://developers.google.com/maps/documentation/javascript/reference?csw=1#MarkerOptions\n.. _Lat/Lng Object Literals: https://developers.google.com/maps/documentation/javascript/examples/map-latlng-literal\n", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/akiokio/django-geoposition/tarbal/0.2.2", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/akiokio/django-geoposition", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "akiokio-django-geoposition", "package_url": "https://pypi.org/project/akiokio-django-geoposition/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/akiokio-django-geoposition/", "project_urls": { "Download": "https://github.com/akiokio/django-geoposition/tarbal/0.2.2", "Homepage": "http://github.com/akiokio/django-geoposition" }, "release_url": "https://pypi.org/project/akiokio-django-geoposition/0.2.2/", "requires_dist": null, "requires_python": null, "summary": "Django model field that can hold a geoposition, and corresponding admin widget.", "version": "0.2.2" }, "last_serial": 2073386, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "1e9eda9024323882ef4779e7cdcb2295", "sha256": "ad390bf2f2d60f5462bb4e76a1daaf71bdca27aa6e5092851db7e6dd28e7e88d" }, "downloads": -1, "filename": "akiokio-django-geoposition-0.2.0.tar.gz", "has_sig": false, "md5_digest": "1e9eda9024323882ef4779e7cdcb2295", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9921, "upload_time": "2014-06-16T21:20:52", "url": "https://files.pythonhosted.org/packages/87/f4/e4e89d6cb566ffa3c673f1acb7f733c20912e1a570c49da49d92cf3f786e/akiokio-django-geoposition-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "355383761052f30660a5fe8d9a389f20", "sha256": "abdbac064795379c0d9b17b3ee30ed6bf1d889f76ee7a3e08a05d3cc8913a6b9" }, "downloads": -1, "filename": "akiokio-django-geoposition-0.2.1.tar.gz", "has_sig": false, "md5_digest": "355383761052f30660a5fe8d9a389f20", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10864, "upload_time": "2015-11-04T17:01:27", "url": "https://files.pythonhosted.org/packages/b2/d5/1773060bd5c51c563b96747f1a7b9ff2bffadfa5a958f9178e4f2ab332df/akiokio-django-geoposition-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "27b7380deab3edca17ec72f8af321a03", "sha256": "62675cac247a7acbbb93bcadf7b05e7bfac633cdf65591ae9dd16819ba5db5ef" }, "downloads": -1, "filename": "akiokio-django-geoposition-0.2.2.tar.gz", "has_sig": false, "md5_digest": "27b7380deab3edca17ec72f8af321a03", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10857, "upload_time": "2016-04-20T06:15:26", "url": "https://files.pythonhosted.org/packages/ee/78/fb59529c183a3df83159a8eeb681a7f2c809b32b962a640e7aedf7064ec9/akiokio-django-geoposition-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "27b7380deab3edca17ec72f8af321a03", "sha256": "62675cac247a7acbbb93bcadf7b05e7bfac633cdf65591ae9dd16819ba5db5ef" }, "downloads": -1, "filename": "akiokio-django-geoposition-0.2.2.tar.gz", "has_sig": false, "md5_digest": "27b7380deab3edca17ec72f8af321a03", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10857, "upload_time": "2016-04-20T06:15:26", "url": "https://files.pythonhosted.org/packages/ee/78/fb59529c183a3df83159a8eeb681a7f2c809b32b962a640e7aedf7064ec9/akiokio-django-geoposition-0.2.2.tar.gz" } ] }