yourcelf / olwidget

Javascript library to replace textareas that contain WKT data with editable OpenLayers maps, and a django app using it for django forms and admin.
Other
91 stars 44 forks source link

Feature Request: set class (other attributes?) of map div #44

Open spacedman opened 13 years ago

spacedman commented 13 years ago

Could it be possible to set the class of the DIV created by InfoMap instances (and possibly the others). At the moment the template creates it with only an id attribute, but it would be useful for the rendering template to set the class. This could also extend to other attributes of the DIV, but of course all your styling should be done by class/id anyway.

spacedman commented 13 years ago

Looking at the code, this seems to be because there's no attrs parameter passed to the Map constructor. This seems to be the standard way to pass attributes to widget HTML (from my inspection of the Django widget codes).

cazgp commented 12 years ago

I just implemented a small tweak to make this possible. Simply change the constructor of "Map" to add "attrs=None" at the end, and then pass attrs to the super constructor.

I can write this into a patch - should I pull and request a commit? Is this a bug or a decision?