Weird behaviour with OSMGeoAdmin as map instance using get_map_widget()

34 views
Skip to first unread message

Max Demars

unread,
Apr 19, 2013, 10:16:36 AM4/19/13
to geod...@googlegroups.com

Hi,

I have an app that use OSMGeoAdmin (I have the same issue with GeoModelAdmin) as a map instance (outside of the admin) produced with the get_map_widget() method like this:

def getMapForm(shapefile):
    geometryField = calcGeometryField(shapefile.geom_type)
    adminInstance = admin.OSMGeoAdmin(Feature, admin.site)
    field = Feature._meta.get_field(geometryField)
    widgetType = adminInstance.get_map_widget(field)
    widgetType.params.update({'map_width':1000, 'map_height': 700})

    class MapForm(forms.Form):
        geometry = forms.CharField(widget=widgetType(), label="")

    return MapForm

The problem is when I zoom on a feature inside the OSMGeoAdmin instance, at a certain zoom level the feature flip so like you can see in those pictures in this post: http://gis.stackexchange.com/questions/58560/geodjango-weird-behaviour-with-osmgeoadmin

This problem occur only in the OSMGeoAdmin map instance and not in the real GeoAdmin tool.

Do you have an idea of what could be in cause here?

Thank you,

Max Demars

Max Demars

unread,
Apr 19, 2013, 1:34:32 PM4/19/13
to geod...@googlegroups.com
Edit to the post: the same problem occur inside the standard OSMGeoAdmin and GeoModelAdmin
Reply all
Reply to author
Forward
0 new messages