Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6739323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:28:26+00:00 2026-05-26T11:28:26+00:00

I am trying to add multiple pushpin with separate infobox. that means each pushpin

  • 0

I am trying to add multiple pushpin with separate infobox. that means each pushpin will have their own infobox with own info.
there is a loop.inside that

latlng = new Microsoft.Maps.Location(latitude[pointerCount], longtitue[pointerCount]);
MarkingLocation[pointerCount] = new Microsoft.Maps.Pushpin(latlng, {icon:"marker2.ico", height:50, width:50, anchor:new Microsoft.Maps.Point(0,50)}); 

myInfobox = new Microsoft.Maps.Infobox(latlng, myinfoboxOption);

Microsoft.Maps.Events.addHandler(MarkingLocation[pointerCount], 'click', function() {myInfobox.setOptions({ visible:true });});         
map.entities.push(MarkingLocation[pointerCount]);
map.entities.push(myInfobox);

Problem is that it’s showing the last infobox only for every pushpin. Suppose I’ve 4 pushpin in Londom,France,Germany,America. now no matter which pin I’ve clicked, it’s only show the America infobox on America pushpin.please can anyone help that what I’ve been missing………

And one more thing, can anyone please show the way to use htmlContent in infobox. I’ve tried to set it thrugh option,but it’s not woring……

myinfoboxoption = {width:300, 
                              height: 100, 
                              title: str_loc, 
                              htmlContent: htmlc, 
                              showPointer: false, 

                              offset: new Microsoft.Maps.Point(-100,0)};

Please help……..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:28:27+00:00Added an answer on May 26, 2026 at 11:28 am

    This is how I implemented multiple infobox:

    <html>
    <head>
    <script charset="UTF-8" type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"></script>
    <script>
        var pinInfoBox;  //the pop up info box
        var infoboxLayer = new Microsoft.Maps.EntityCollection();
        var pinLayer = new Microsoft.Maps.EntityCollection();
        var apiKey = "YourKey";
    
        function GetMap() {
    
            map = new Microsoft.Maps.Map(document.getElementById("map"), {credentials: apiKey});
    
            // Create the info box for the pushpin
            pinInfobox = new Microsoft.Maps.Infobox(new Microsoft.Maps.Location(0, 0), { visible: false });
            infoboxLayer.push(pinInfobox);
    
    
            for (var i = 0 ; i < 10; i++){
                //add pushpins
                var latLon = new Microsoft.Maps.Location(Math.random()*180-90, Math.random()*360-180);
                var pin = new Microsoft.Maps.Pushpin(latLon);
                pin.Title = name;//usually title of the infobox
                pin.Description = "blahblahblah, "+ i; //information you want to display in the infobox
                pinLayer.push(pin); //add pushpin to pinLayer
                Microsoft.Maps.Events.addHandler(pin, 'click', displayInfobox);
            }
    
            map.entities.push(pinLayer);
            map.entities.push(infoboxLayer);
    
        }
    
        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());
        }
    
        function hideInfobox(e) {
            pinInfobox.setOptions({ visible: false });
        }
    </script>
    
    <style>
        #map { position: absolute; top: 20; left: 10; width: 700px; height: 500px; border:#555555 2px solid;}
    </style>
    </head>
    <body onload="GetMap()">
        <div id="map">
        </div>
    </body>
    

    In the end, you will get something like this:
    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to add some multiple form fields in separate divs. But by
I have a UINavigationController . I'm trying to add multiple buttons on the right
Hi there men of the coding realm. Im trying to add the 'multiple' attribute(?)
I have a string that I am creating, and I need to add multiple
I'm trying to add multiple instances of UIImageView(s) to an NSMutableArray of NSMutableDictionar(ies). I
I'm trying to add multiple jQuery data entries to a single element. I suspected
I'm fairly new to JQuery and I'm trying to add multiple form fields for
Ok, I am trying to add one row of multiple images to a JPanel,
I'm trying add a tab to my web page that looks like this: Using
trying to add an ExpiresDefault ExpiresByType to content on my website so that way

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.