Skip to content

Latest commit

 

History

History
70 lines (50 loc) · 2.12 KB

supported-geocoders.md

File metadata and controls

70 lines (50 loc) · 2.12 KB

Supported Geocoders

Geocoders are used by the address field (GeoAddressPanel/GeoAddressBlock) to enable searching for places in the map. We currently support these services:

Nominatim

Url: https://nominatim.org/

Example:

from django.contrib.gis.db import models
from wagtail.models import Page
from wagtailgeowidget import geocoders
from wagtailgeowidget.blocks import GeoAddressPanel, LeafletPanel

class ExamplePage(Page):
    address = models.CharField(max_length=250, blank=True, null=True)
    location = models.PointField(srid=4326, null=True, blank=True)

    content_panels = Page.content_panels + [
        GeoAddressPanel("address", geocoder=geocoders.NOMINATIM),
        LeafletPanel("location", address_field="address"),
    ]

Google Maps Geocoding

Url: https://developers.google.com/maps/documentation/javascript/geocoding

Example:

from django.contrib.gis.db import models
from wagtail.models import Page
from wagtailgeowidget import geocoders
from wagtailgeowidget.blocks import GeoAddressPanel, LeafletPanel

class ExamplePage(Page):
    address = models.CharField(max_length=250, blank=True, null=True)
    location = models.PointField(srid=4326, null=True, blank=True)

    content_panels = Page.content_panels + [
        GeoAddressPanel("address", geocoder=geocoders.GOOGLE_MAPS),
        LeafletPanel("location", address_field="address"),
    ]

Mapbox

Url: https://docs.mapbox.com/api/search/geocoding/

Example:

from django.contrib.gis.db import models
from wagtail.models import Page
from wagtailgeowidget import geocoders
from wagtailgeowidget.blocks import GeoAddressPanel, LeafletPanel

class ExamplePage(Page):
    address = models.CharField(max_length=250, blank=True, null=True)
    location = models.PointField(srid=4326, null=True, blank=True)

    content_panels = Page.content_panels + [
        GeoAddressPanel("address", geocoder=geocoders.MAPBOX),
        LeafletPanel("location", address_field="address"),
    ]