diff --git includes/behaviors/js/openlayers_behavior_cluster.js includes/behaviors/js/openlayers_behavior_cluster.js index e451f41..e966ce8 100644 --- includes/behaviors/js/openlayers_behavior_cluster.js +++ includes/behaviors/js/openlayers_behavior_cluster.js @@ -4,10 +4,13 @@ * OpenLayers Behavior implementation for clustering. */ +(function ($) { + /** * OpenLayers Cluster Behavior */ -Drupal.behaviors.openlayers_cluster = function(context) { +Drupal.behaviors.openlayers_cluster = { + attach: function(context) { var data = $(context).data('openlayers'); if (data && data.map.behaviors.openlayers_behavior_cluster) { var options = data.map.behaviors.openlayers_behavior_cluster; @@ -36,6 +39,7 @@ Drupal.behaviors.openlayers_cluster = function(context) { } } } + } }; /* @@ -63,3 +67,5 @@ Drupal.theme.openlayersPopup = function(feature) { return Drupal.theme.prototype.openlayersPopup(feature); } }; + +})(jQuery);