In keeping with Django 1.3’s new support for static media files, the location of olwidget’s media has changed, to:
In addition, the
OLWIDGET_MEDIA_URL setting has been renamed
OLWIDGET_STATIC_URL, and templates rendered by olwidget now receive
STATIC_URL instead of
MEDIA_URL as context. The setting
is also required. This has the potential to break symlinks to olwidget’s
static media files.
The olwidget CSS class names have been changed to be prefixed with “olwidget”, to avoid colliding with other generic class names like “container”. Custom css that expects to select olwidget’s elements will need to be updated to use olwidget-prefixed names.
Since Google Maps API v2 is now deprecated,
olwidget has switched to Google
Maps API v3. Customizations that depend on Google Maps v2 will need to be
updated to use v3 instead.
Support for Django less than 1.4 is removed.
Version 0.4 represents a complete overhaul of olwidget to build in support for multiple vector layers. As such, chances are high that v0.4 will break any custom extensions that make use of undocumented implementation details. However, the public, documented API from v0.3 is compatible with v0.4. The following are notable changes that have a higher probability of breaking your app if you did customization.
map.vector_layerno longer exists; it has been replaced with an array,
olwidget.jsnow uses version 2.9 of the OpenLayers API. Django users should get this change automatically, but
olwidget.jsusers will have to change their script tags for the OpenLayers import.
olwidget.widgets.OLWidget has been renamed
"olwidget/olwidget.html" template has been renamed
admin.custom_geo_admin method has been removed. Instead, just
olwidget.admin No longer inherits from
django.contrib.admin. The old
from olwidget import admin # no longer works admin.site.register(MyModel, admin.GeoModelAdmin)
Instead, import admin from
django.contrib as normal, and import
olwidget, like this:
from django.contrib import admin from olwidget.admin import GeoModelAdmin admin.site.register(MyModel, GeoModelAdmin)
olwidget.Map has been renamed
Many of the options parameters’ names have changed, mostly to conform to OpenLayers’ mixedCase standard:
mapDivClass(note addition of “Div”)
mapDivStyle(note addition of “Div”)
'yahoo'map layer is now called
All internal methods and variables have also changed to use mixedCase.
Map types now inherit from
customizations that access the base map type.
The old way:
var mymap = new olwidget.Map('textareaId'); mymap.map.zoomTo(4);
The new way:
var mymap = new olwidget.EditableMap('textareaId'); mymap.zoomTo(4);