Hello,
while creating a formset containing maps, I found a problem related to how the single map objects DOM ids are created.
This in turn make OLWidget create JS objects with instructions like
var olwidget_id_form-0-Location = new olwidget.Map("id_form-0-Location", [...
Needless to say, Javascript takes the variable name as olwidget_id_form - 0 - Location and throws an error.
I have no idea how these ids are passed to the Map.render function (In my post about Map Legends I had the opposite problem: in a standalone map, outside of a form, I would always get a random id) but I suspect that field forms get their ids passed to OLWidget while normal maps outside form do not.
But unless I'm doing something wrong with the formset preparation and the related fieldnames (it's my second attempt at using one and the first including MapFields) I think there's a need to sanitize the 'id' we get from the template so that it's JS compatible.
What do you think?
Roberto