Skip to main content

A Django app to work with geolocation fields without a spatial database.

Project description

django-geolocation-fields

A Django app to facilitate the manipulation of Geolocation objects in a GeoDjango app without using a spatial database.

Detailed documentation is in the "docs" directory.

Quick start

The project is still in development

Here is an example that uses it https://github.com/syk1k/django-geolocation

  1. Add "geolocation_fields" to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        #...
        'geolocation_fields',
    ]
    
  2. Add a PointField to a model:

    from geolocation_fields.models import fields
    field_name = fields.PointField(verbose_name='field_name')
    
  3. Configurations To have more control over the package, you can canfigure it yourself

    By default the PointField's widget only display the map, you can also chose to display the editable input field in the settings

    GEOLOCATION_FIELD = {
        'display_input': True, # Display the input field. False to remove
    }
    

    This version of the package integrate leaflet only. Here is the default configuration for the fields (PointField for the moment). The configurations uses leaflet Map options. Check the leafletJS doc here

    GEOLOCATION_FIELD = {
        "provider": "leaflet", # Two provider: Leaflet, Mapbox
        "center" : [0,0],
        "zoom": 12,
        'display_input': False,
    }
    

Screenshots

  1. With the input field displayed

with_input

  1. Without input field

without_input

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-geolocation-fields-0.1.5.tar.gz (843.1 kB view hashes)

Uploaded Source

Built Distribution

django_geolocation_fields-0.1.5-py3-none-any.whl (700.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page