Closed (fixed)
Project:
Openlayers
Version:
6.x-2.x-dev
Component:
Code
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
4 Jul 2010 at 18:29 UTC
Updated:
22 Aug 2010 at 22:20 UTC
It is messy to put objects (functions) in the document object as well as creates a higher possibility of name collision. It is also messy and annoying to do this.
Drupal.settings.openlayers = {};
Drupal.settings.openlayers.maps = {};
Drupal.openlayers.layer = {};
We should find a unified way to handle things like this.
Comments
Comment #1
tmcw commentedComing from Drupal, it's entirely unavoidable. Within all other code, like behaviors and layer types, we should use .data() for arbitrary data.
Comment #2
zzolo commentedWhat about functions like
openlayers_behavior_fullscreen_toggle = function(context) {, if there is no elegant way to do this, I would rather see something like this in the beginning of the module"Then have this:
Comment #3
tmcw commentedIdeally callbacks are anonymous functions. In other cases, I don't think it's a good idea to have a freerange callbacks dictionary, but rather that contained functions should be attributes of the behavior functions themselves.
So,
Drupal.behaviors.openlayers_behavior_fullscreen.toggle = function(context) {Comment #4
tmcw commentedOkay, so to make this actionable, these behaviors use globals:
Comment #5
tmcw commentedFixed in boxselect with: http://drupal.org/cvs?commit=403502
Will be fixed in drawfeatures when most recent patch is committed.
Comment #6
tmcw commentedFixed in #721924: CCK does not limit features for drawfeatures.