javascript - Drupal - OpenLayers - Alter popup behavior -
i have modified popup behavior js file: openlayers_behavior_popup.js directly in module located @ openlayers/plugins/behaviors.
it's working fine per expected not want put own modification in original module, want add attach existing module don't know how this.
i want site not take behavior @ openlayers/plugins/behaviors follow popup behavior code own module.
drupal.openlayers.addbehavior('openlayers_behavior_popup', function (data, options) { // normal var popupselect = new openlayers.control.selectfeature(layers, { // change here!! }, onunselect: function(feature) { // normal } } ); }); how can alter behavior code of openlayers?
i have solved issue on topic load modification javascript file in custom module following:
function mycustom_openlayers_init() { // might want load @ specific page // if want so, please have function arg() of drupal // place condition before loading js file below drupal_add_js ( drupal_get_path ( 'module', 'mycustom_openlayers' ) . '/js/openlayers_behavior_popup.js', array( 'weight' => '9999', ) ); } by specifying setting of weight bigger, javascript loaded after loading original openlayers popup file , overrides behavior of original take mine instead.
i don't know if right thing works me.
please let me know if other people give me programmatic solution on , better above.
Comments
Post a Comment