Select to view content in your preferred language

popup content not sync'd with graphic selection

541
1
12-05-2012 12:15 PM
danbecker
Frequent Contributor
-click 2 overlapping features from 2 dif. featLayers.
-Popup auto-selects and highlights map.infoWindow.features[0]
-the popup content is actually from map.infoWindow.features[1]

after you navigate to the second graphic and back, the popup corrects it's self??

here's the method of fetching graphics/setting infoTemplates

1. buffer map click
2. fill array with all graphics from baseFeatLayers
3. dojo.filter graphics that intersect buffered map click
4. loop over filtered graphics array, setting infoTemplates based on the layer that graphics came from
5. pass selected filtered graphics array to map.infoWindow.setFeatures

here's an example using esri data:
http://jsfiddle.net/92Q2G/1/

any advice?
Thanks.
0 Kudos
1 Reply
danbecker
Frequent Contributor
i **think** map.infoWindow.setFeatures was trying to select the first map.infoWindow.feature before it was actually there??

ended up using a setTimeout() workaround to delay setFeatures() a few miliseconds.

updated:
http://jsfiddle.net/92Q2G/2/
0 Kudos