Map features
The geo-fields, enable the user to define geo-objects on a
MapView
/ GeoJSONView
.
Draw a point
The GeoPointField
enables the user to draw a point on the map, which is
returned in the params
as a GeoPoint
:
import viktor as vkt
class Parametrization(vkt.Parametrization):
geo_point = vkt.GeoPointField('Draw a point')
Draw a polyline
The GeoPolylineField
enables the user to draw a polyline on the map,
which is returned in the params
as a GeoPolyline
:
import viktor as vkt
class Parametrization(vkt.Parametrization):
geo_polyline = vkt.GeoPolylineField('Draw a polyline')
Draw a polygon
The GeoPolygonField
enables the user to draw a polygon on the map,
which is returned in the params
as a GeoPolygon
:
import viktor as vkt
class Parametrization(vkt.Parametrization):
geo_polygon = vkt.GeoPolygonField('Draw a polygon')
Visualize geo-objects on the map
The above geo-fields let the user 'draw' geo-objects, but does not actually visualize it on the map. If visualizing the geo-objects on the map is desired, this can easily be achieved by making use of the class-method on the corresponding map feature as described here.
Interact with geo-objects on the map
In addition to visualizing geo-objects, it is also possible to let the user interact with the geo-objects on the map.