Created
July 5, 2012 21:42
-
-
Save guizmo/3056670 to your computer and use it in GitHub Desktop.
Openlayers showPopup()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Drupal.settings.nid = Drupal.settings.nid || []; | |
Drupal.settings.getAllFeature; | |
function my_map() { | |
var all_layers = Drupal.openlayers.popup.popupSelect.layers; | |
for(var key1 in all_layers) { | |
var current_layer = all_layers[key1]; | |
var all_features_in_layer = current_layer.features; | |
for(var key2 in all_features_in_layer) { | |
var current_feature = all_features_in_layer[key2]; | |
Drupal.settings.nid[current_feature.attributes.nid] = current_feature; | |
} | |
} | |
} | |
function show_popup(nid) { | |
if (Drupal.settings.nid) { | |
var feature = Drupal.settings.nid[nid]; | |
Drupal.openlayers.popup.popupSelect.clickFeature(feature); | |
} | |
} | |
$(document).ready(function(){ | |
my_map(); | |
}); | |
//from http://drupal.org/node/1009374#comment-6200888 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment