Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Currently:
// Hook to alter map.
// Styles, behaviors, layers may all be added here.
drupal_alter('openlayers_postrender', $map);
// styles and layer styles are not required parameters
$map['styles'] = isset($map['styles']) ?
$map['styles'] : array();
$map['layer_styles'] = isset($map['layer_styles']) ?
$map['layer_styles'] : array();
// Assign an ID
$map['id'] = !isset($map['id']) ?
_openlayers_create_map_id() : $map['id'];
$map['layers'] = _openlayers_layers_process($map['layers'], $map);
$map['behaviors'] = _openlayers_behaviors_render($map['behaviors'], $map);
$map['styles'] = _openlayers_styles_process($map['styles'], $map['layer_styles'], $map);
// Hook to alter map one last time
// Final modification to existing styles, behaviors, layers can happen here,
// but nothing new may be added.
drupal_alter('openlayers', $map);
Notice that the postrender hook comes before the actual rendering. I'll have to look for the discussion but I believe we had already decided to leave the openlayers_alter after the rendering, and use a openlayers_prerender_alter before. I'll have to double check, but nonetheless this needs to be updated and documented.
Comments
Comment #1
zzolo CreditAttribution: zzolo commentedAlso, please note that somewhere along the line:
Change to this:
It should be back the old way as we are altering a map, not openlayers as a whole.
Comment #2
zzolo CreditAttribution: zzolo commentedhttp://drupal.org/cvs?commit=362214
Updated map alters to:
*
hook_openlayers_map_preprocess_alter(&$map)
*
hook_openlayers_map_alter(&$map)
Updated documentation:
* Put openlayers.api.php back in as this the best mechanism to provide doxygen formatted documentation for hooks. This could be flushed out some more. Ideally this could mostly just link to handbook pages.
* Updated CHANGELOG.txt
Provided test