Download & Extend

2.x: Change Behavior Architecture to use CTools Plugins

Project:OpenLayers
Version:6.x-2.x-dev
Component:OpenLayers Behaviors
Category:task
Priority:normal
Assigned:zzolo
Status:closed (fixed)

Issue Summary

Starting new ticket. The new behaviors system uses a CTools plugin with context, meaning that the plugin changes based on "context" of where it is being used (see CTools plugin example module and help).

Comments

#1

Notes

* See openlayers_openlayers_behaviors() to see how we are defining behaviors.
* We should discuss what behaviors need to be part of core module and in behaviors modules
* Check names of behaviors
* Core changes and copying core behaviors from 0.x version: http://drupal.org/cvs?commit=268234

#2

* Looking at all these behaviors. Something to note: They all pretty much include a JS file. All we have to do is standardize where these js files are include automatically.
* Overview Map in core plugin class was not named correctly (and does not work)
* DOCUMENTATION! (basic documentation is missing, added some)
* Removed old behavior good from openlayers.js
* Updated and added some maps to the the test module for testing
* Changed default map preset to use the new behaviors
* Technically the Controls array still works
* I don't relly like this naming convention, but a lot of work to change: $(this).data('openlayers', {'map': map, 'openlayers': openlayers});
* Behaviors JS should check that the behaviors exists before checking for array. See #589642: 2.x: The Behaviors JS Functiosn provided by 0.x Do Not Check BEhaviors Correctly
* Behaviors in openlayers_behaviors need to be looked at in more detail

TODO:

* Test and review
* Move over the behaviors in openlayers_behavior. I copied over the ones in the 0.x branch and these should work, but there is definitely need to review and look at the ones that the 0.x did not address. I'm gonna make this another ticket, since the architecture has changed.

http://drupal.org/cvs?commit=268300

#3

Also, need to make the switch on the UI. Shoud move layers to ctools first and do the big push on the UI together

#4

Need to address UI, will do after layers have been moved to ctools.

#5

Also need to address CCK and Views that use behaviors.

#6

Re: automatically including javascript files with behaviors, I am opposed because in many cases it makes sense to include multiple javascript files; the most common case is that a behavior will include the javascript file for an OpenLayers standard control or a custom control like LayerSwitcherPlus, and then a simple javascript file that encapsulates that control in a drupal behavior fashion. Merging the two files would be bad architecture. Also, moving all controls and their javascript into behaviors could be a very good idea because it reduces the size of the openlayers library in a natural way.

#7

#8

Status:active» fixed

This was completed long ago; let's open tickets for more specific issues.

#9

Status:fixed» closed (fixed)