Yes, by passing hide_latlng=True
to the GeoPanel.
GoogleMapsPanel('location', address_field='address', hide_latlng=True)
For streamfields use the following:
GoogleMapsBlock(address_field='address', hide_latlng=True)
By using GOOGLE_MAPS_V3_APIKEY_CALLBACK
you can implement a custom behaviour for retriving api key, this will ignore GOOGLE_MAPS_V3_APIKEY
. Implementation example:
# settings.py
GOOGLE_MAPS_V3_APIKEY_CALLBACK = "home.helpers.get_apikey"
# home/helpers.py
def get_apikey():
from home.models import GeoWidgetSettings
settings = GeoWidgetSettings.objects.first()
return settings.google_maps_apikey
# home/models.py
from django.db import models
from wagtail.contrib.settings.models import (
BaseSiteSetting,
register_setting
)
from wagtail.admin.panels import FieldPanel
@register_setting
class GeoWidgetSettings(BaseSiteSetting):
google_maps_apikey = models.CharField(
help_text="Google maps api key", max_length=255
)
panels = [
FieldPanel("google_maps_apikey"),
]
Yes, by adding the css class geo-field-zoom--hide
you can hide the field in the admin.
-
Field panel:
FieldPanel("zoom", classname="geo-field-zoom--hide")
-
In streamfield:
('zoom', GeoZoomBlock(required=False, form_classname="geo-field-zoom--hide")),