In keeping with Django 1.3’s new support for static media files, the location of olwidget’s media has changed, to:
olwidget/static/olwidget
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 STATIC_URL 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.
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.
olwidget.widgets.OLWidget has been renamed olwidget.widgets.EditableMap
The "olwidget/olwidget.html" template has been renamed "olwidget/editable_map.html"
The admin.custom_geo_admin method has been removed. Instead, just subclass olwidget.admin.GeoModelAdmin.
olwidget.admin No longer inherits from django.contrib.admin. The old way:
from olwidget import admin
# no longer works
admin.site.register(MyModel, admin.GeoModelAdmin)
Instead, import admin from django.contrib as normal, and import GeoModelAdmin from olwidget, like this:
from django.contrib import admin
from olwidget.admin import GeoModelAdmin
admin.site.register(MyModel, GeoModelAdmin)
olwidget.Map has been renamed olwidget.EditableMap
Many of the options parameters’ names have changed, mostly to conform to OpenLayers’ mixedCase standard:
All internal methods and variables have also changed to use mixedCase.
Map types now inherit from OpenLayers.Map. This affects javascript 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);