Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Using this plugin (source) to load pins from an xml file, pins get added correctly, but now trying to add infoboxes to each respective pin.

In the function that receives the array of pins I'm trying to loop through each item and add infoboxes accordingly. Any ideas as to what I'm missing here?

      function GeoRSSImportedCallback(items, bounds) {
          map.entities.push(items);

          for (var i = 0; i<items.length; i++) {
            items[i].Title = items[i].title;
            items[i].Description = items[i].description;
            Microsoft.Maps.Events.addHandler(itmes[i], 'click', displayInfoBox);
          }

          map.entities.push(infoboxLayer);
          map.setView({ bounds: bounds });
      }

    function displayInfoBox(e) {
        pinInfoBox.setOptions({title: e.target.Title, description: e.target.Description, visible:true, offset: new Microsoft.Maps.Point(0,25)});
        pinInfoBox.setLocation(e.target.getLocation());
}

I do initialize the following in the GetMap() function

        pinInfoBox = new Microsoft.Maps.Infobox(new Microsoft.Maps.Location(0, 0), { visible: false });
        infoboxLayer.push(pinInfoBox);
share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.