none
How to suppress the sequential numbers for each street on my route RRS feed

  • Question

  • When my bing map displays, I do not want to show the numbers for each street / road leg. I just want the colored street line to connect each of my locations.  How can I suppress this?

     

    Thanks,

    Bob

    • Moved by Ricky_Brundritt Saturday, March 10, 2012 1:17 PM (From:Bing Maps: Map Control and Web services Development)
    Thursday, February 2, 2012 4:51 PM

Answers

  • I'll assume you are using Bing Maps V6.3 as V7 does not put numbers on the route line. Here is a code example that hides the street numbers, but leaves the start and end pushpins and the route line:

     

    <!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=6.3"></script>
    
          <script type="text/javascript">
             var map = null;
    
             function GetMap()
             {
                map = new VEMap('myMap');
    
    		map.SetCredentials("YOUR_BING_MAPS_KEY");
                map.LoadMap();
    			
    			//Load a route
    			var myOptions = new VERouteOptions();
    			myOptions.RouteCallback = myRouteHandler;  
    			map.GetDirections(["space needle", "LA Coliseum", "area 51"], myOptions);
    			map.GetDirections(["1 Microsoft Way, 98052", new VELatLong(47.969,-122.39, 0, VEAltitudeMode.RelativeToGround)], myOptions);
             }
    
    		function myRouteHandler(route)
    		{
    		   var legs = route.RouteLegs;
    
    		   for(var i = 0; i < legs.length; i++)
    		   {
    			  for(var j = 0; j < legs[i].Itinerary.Items.length; j ++)
    			  {
    				 if(i + j != 0 && i + j != legs.length + legs[i].Itinerary.Items.length - 2){
    					legs[i].Itinerary.Items[j].Shape.Hide();  
    				 }
    			  }
    		   }
    		}
          </script>
       </head>
       <body onload="GetMap();">
          <div id='myMap' style="position:relative; width:400px; height:400px;"></div>
       </body>
    </html>
    

     


    http://rbrundritt.wordpress.com
    • Edited by Ricky_Brundritt Thursday, February 2, 2012 6:01 PM Adding credentials code
    • Marked as answer by Ricky_Brundritt Monday, February 27, 2012 11:38 AM
    Thursday, February 2, 2012 6:00 PM

All replies

  • I'll assume you are using Bing Maps V6.3 as V7 does not put numbers on the route line. Here is a code example that hides the street numbers, but leaves the start and end pushpins and the route line:

     

    <!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=6.3"></script>
    
          <script type="text/javascript">
             var map = null;
    
             function GetMap()
             {
                map = new VEMap('myMap');
    
    		map.SetCredentials("YOUR_BING_MAPS_KEY");
                map.LoadMap();
    			
    			//Load a route
    			var myOptions = new VERouteOptions();
    			myOptions.RouteCallback = myRouteHandler;  
    			map.GetDirections(["space needle", "LA Coliseum", "area 51"], myOptions);
    			map.GetDirections(["1 Microsoft Way, 98052", new VELatLong(47.969,-122.39, 0, VEAltitudeMode.RelativeToGround)], myOptions);
             }
    
    		function myRouteHandler(route)
    		{
    		   var legs = route.RouteLegs;
    
    		   for(var i = 0; i < legs.length; i++)
    		   {
    			  for(var j = 0; j < legs[i].Itinerary.Items.length; j ++)
    			  {
    				 if(i + j != 0 && i + j != legs.length + legs[i].Itinerary.Items.length - 2){
    					legs[i].Itinerary.Items[j].Shape.Hide();  
    				 }
    			  }
    		   }
    		}
          </script>
       </head>
       <body onload="GetMap();">
          <div id='myMap' style="position:relative; width:400px; height:400px;"></div>
       </body>
    </html>
    

     


    http://rbrundritt.wordpress.com
    • Edited by Ricky_Brundritt Thursday, February 2, 2012 6:01 PM Adding credentials code
    • Marked as answer by Ricky_Brundritt Monday, February 27, 2012 11:38 AM
    Thursday, February 2, 2012 6:00 PM
  • Thanks for the reply. 

    Actually, I'm using a control I found online.  It's the Simplovation Web Map control.  It allows you to do everything server-side.  I am terrible with javascript so this is why I downloaded this control.  But it must be based on the 6.3 version like you said.

    So if I put the javascript you sent me in my html it should fix my problem?

     

    Bob

     

     

    Thursday, February 2, 2012 7:13 PM