gis.forms.fields
Classes
Represents a single pair of coordinates with optional zoom and |
|
Module Contents
- class gis.forms.fields.CoordinatesField(label: str | None = None, validators: onegov.form.types.Validators[onegov.form.types.FormT, Self] | None = None, filters: collections.abc.Sequence[wtforms.fields.core._Filter] = (), description: str = '', id: str | None = None, default: onegov.gis.models.coordinates.AnyCoordinates | collections.abc.Callable[[], onegov.gis.models.coordinates.AnyCoordinates] | None = None, widget: wtforms.fields.core._Widget[Self] | None = None, render_kw: dict[str, Any] | None = None, name: str | None = None, _form: wtforms.form.BaseForm | None = None, _prefix: str = '', _translations: wtforms.meta._SupportsGettextAndNgettext | None = None, _meta: wtforms.meta.DefaultMeta | None = None, *, fieldset: str | None = None, depends_on: collections.abc.Sequence[Any] | None = None, pricing: onegov.form.types.PricingRules | None = None)[source]
Bases:
wtforms.fields.StringFieldRepresents a single pair of coordinates with optional zoom and marker icon/color selection.
In the browser and during transit the point is stored as a base64 encoded json string on a simple input field. For example:
eydsYXQnOiA4LjMwNTc2ODY5MTczODc5LCAnbG.. (and so on) => {'lon': 8.30576869173879, 'lat': 47.05183585, 'zoom': 10}
For verification: This points to the Seantis office in Lucerne.
For convenience, the coordinates are accessible with the
onegov.gis.models.coordinates.Coordinatesclass when ‘data’ is used.Note that this field doesn’t work with the
InputRequiredvalidator. Instead theDataRequiredvalidator has to be chosen.
- class gis.forms.fields.CoordinatesFieldRenderer[source]
Bases:
onegov.form.display.BaseRenderer- __call__(field: CoordinatesField) markupsafe.Markup[source]