Форум сайта python.su
может кто-то сталкивался с подобным и сможет подсказать.
Использую виджет из пакета django-floppyforms, который рисует карту и в текстовое поле вносит координаты точки установленной пользователем.
class GMapPolygonWidget(floppyforms.gis.BaseGMapWidget, floppyforms.gis.PolygonWidget): pass class FindAdvertForm6(floppyforms.Form): poly = floppyforms.gis.PolygonField(widget=GMapPolygonWidget())
Офлайн
The following options can be passed to the widget constructor:
base_layer: an OpenLayers.Layer instance (or an instance of a subclass) that will be used as a base layer for the map. Default: Metacarta’s base WMS layer.
color: the color of the features drawn on the map. Default: ‘ee9900’.
default_lon: the default longitude to center the map on if there is no feature. Default: 0.
default_lat: the default latitude to center the map on if there is no feature. Default: 0.
Я думаю как-то так:
var options = { geom_type: OpenLayers.Geometry.Point, id: 'id_point', is_point: true, map_id: 'point_map', name: 'My awesome point', default_lon: 10, default_lat: 10 }; var point_map = new MapWidget(options);
Офлайн