none
select and copy the contents from the pushpin infobox RRS feed

  • Question

  • I want to select and copy  the contents from the pushpin infobox. It is htmlContent. But I am unable to select or copy it. Sample code for pushpin with html content.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html>
    
     <head>
    
      <title></title>
    
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    
    
    
      <script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"></script>
    
    
    
    
    
      <script type="text/javascript">
    
    
    
       var map = null; 
    
       var pinInfobox = null;  
    
    
    
       function GetMap()
    
       {
    
       // Initialize the map
    
       map = new Microsoft.Maps.Map(document.getElementById("myMap"), {credentials:"key"}); 
    
    
    
       // Retrieve the location of the map center 
    
       var center = map.getCenter();
    
       
    
       // Add a pin to the center of the map
    
       var pin = new Microsoft.Maps.Pushpin(center); 
    
    
    
    			Microsoft.Maps.Events.addHandler(pin, 'mouseover', displayInfobox);
    
    			Microsoft.Maps.Events.addHandler(map, 'viewchange', hideInfobox);
    
    
    
    			var infoboxOptions = {
    
    				showCloseButton: true,
    
    				zIndex: 0,
    
    				offset: new Microsoft.Maps.Point(10, 60),
    
    				htmlContent: "<div style='background-color:White;padding:8px;font-family: Verdana, Arial, Helvetica;width:300px;border-style:solid;border-width:1px;height:auto;border-color:black;font-size:12px;'><b>Custom HTML for selecting and coping the contents.</b></div>;"
    
    			};
    
    			pinInfobox = new Microsoft.Maps.Infobox(center, infoboxOptions);
    
    
    
    			map.entities.push(pin);
    
    			map.entities.push(pinInfobox);
    
    
    
       }
    
    
    
       function displayInfobox(e)
    
       {
    
       pinInfobox.setOptions({ visible:true });
    
       }
    
         
    
    
    
       function hideInfobox(e)
    
       {
    
       pinInfobox.setOptions({ visible: false });
    
       }
    
    
    
    
    
      </script>
    
     </head>
    
     <body onload="GetMap();">
    
      <div id='myMap' style="position:relative; width:700px; height:800px;"></div>  
    
    </html>
    
    

     

    Even if showPointer: true, is added, then too i I am not able to copy.

    • Moved by Ricky_Brundritt Friday, March 9, 2012 5:24 PM (From:Bing Maps: Map Control and Web services Development)
    Wednesday, May 4, 2011 6:04 AM

Answers

  • Thanks for reporting. i think right now no way to select the text in the Infobox. we would see if this feature could be added in next releases.
    HemantGoyal
    Saturday, May 7, 2011 6:18 AM