Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 1.63 KB

settings.md

File metadata and controls

23 lines (18 loc) · 1.63 KB

Settings

  • GOOGLE_MAPS_V3_APIKEY: API key for Google Maps. Defaults to None.

  • GOOGLE_MAPS_V3_LANGUAGE: The language you want to set for the map interface (default is en)

  • GEO_WIDGET_DEFAULT_LOCATION: Default map location when no coordinates are set, accepts a dict with lat and lng keys (default is {'lat': 59.3293, 'lng': 18.0686} that is Stockholm/Sweden).

  • GEO_WIDGET_ZOOM: Default zoom level for map (7 is default).

  • GEO_WIDGET_EMPTY_LOCATION: Defaults to False. If set to True it allows location fields to be optional. When interacting with a location/address field the map will be initialized.

  • GOOGLE_MAPS_V3_APIKEY_CALLBACK: Dotted path to a function used for retrieving Google Maps API Key dynamically (ex mymodule.helpers.get_apikey). Defaults to None.

    # example function
    def get_apikey():
        from home.models import GeoWidgetSettings
    
        settings = GeoWidgetSettings.objects.first()
        return settings.google_maps_apikey
  • GEO_WIDGET_LEAFLET_TILE_LAYER: Which title provider to use in Leaflet. By default it is OSM. (https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png).

  • GEO_WIDGET_LEAFLET_TILE_LAYER_OPTIONS: The tile layer options for leaflet, it supports the following arguments. Default is {"attribution": '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}

  • MAPBOX_ACCESS_TOKEN: Access token fpr Mapbox Geocoding API. Defaults to None.

  • MAPBOX_LANGUAGE: Language parameter for Mapbox Geocoding API. Defaults to en.