Hello. I&#39;m reading in an XML file to create points. I&#39;m trying to assign a popup window with separate content for each marker. When I use the code below, it will only create a popup window for the last XML element in the for loop. Can someone tell me how I can go about binding a popup window to a marker, similar to what the bindinfowindow method does in google maps?<br>
<br>Thanks<br><br><br>var markers = new OpenLayers.Layer.Markers(&quot;Markers&quot;, {displayInLayerSwitcher:true});<br>            <br>xmlDoc  = req.responseXML;<br>xmlValues = xmlDoc.getElementsByTagName(&quot;pt&quot;);<br>
<br>for ( var i = 0; i &lt; xmlValues.length ; i++ ){<br>                <br>                map.addLayer(markers);<br>                lat = xmlValues[i].getAttribute(&quot;lat&quot;);<br>                lng = xmlValues[i].getAttribute(&quot;lon&quot;);<br>
                var zip = xmlValues[i].getAttribute(&quot;zip&quot;);<br>                <br>                var content = zip;<br>                var popup = new OpenLayers.Popup(&quot;popup&quot;, new OpenLayers.LonLat(parseXml.lng,parseXml.lat), new OpenLayers.Size(200,200))<br>
                popup.setContentHTML(content);<br>                map.addPopup(popup);<br>                popup.setContentHTML;<br>                popup.hide();<br>                markers.events.register(&quot;mousedown&quot;, markers, function(){popup.show()});<br>
                markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(lng,lat)));<br>            }<br>