none
Getting distance to nearest station from API RRS feed

  • Question

  • I'd like to query the API with a latlng, and get back the nearest railway station. (This is a POI shown by default in the GUI for Bing Maps in the UK.)

    Is this possible? I can't find any reference to POIs at all, let alone railway stations, in the documentation of the REST API: http://msdn.microsoft.com/en-us/library/ff701702.aspx

    Thanks for your help!

    • Moved by Ricky_Brundritt Friday, March 9, 2012 4:56 PM (From:Bing Maps: Map Control and Web services Development)
    Sunday, January 9, 2011 6:19 PM

Answers

  • a. Use map.setcenterandzoom function and reset your map extent to your geocoordinate as center of map

    b. Use below example which finds all POIs that suit given description with in current map extent


    <!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.2"></script>
          <script type="text/javascript">
          var map = null;
                
          function GetMap()
          {
             map = new VEMap('myMap');
             map.LoadMap();
          }   
             
          function FindNearby()
          {
             try
             {

                // Instead you can use  map.Find("Railway Station", null);
                map.Find(txtWhat.value, null);
             }
             catch(e)
             {
                alert(e.message);
             }
          }
          </script>
       </head>
       <body onload="GetMap();">
          <div id='myMap' style="position:relative; width:400px; height:400px;"></div>
          <input id="txtWhat" type="text" name="txtWhat" />
          <input id="find" type="button" value="Find" name="find" onclick="FindNearby();" />
       </body>
    </html>


    Aditya Tadakaluru MCPD, MCITP, MCTS(Bing Maps)
    Sunday, January 9, 2011 8:49 PM
  • Hi there,

    There is no REST search API, but you can use the SOAP Search Service.

    Since this is a topic that's come up a lot recently, I've just written a blog article that might help you:

    http://alastaira.wordpress.com/2011/01/09/the-bing-maps-soap-search-service/
    Beginning Spatial with SQL Server http://www.apress.com/book/view/1430218290
    Sunday, January 9, 2011 9:06 PM
    Moderator
  • For anyone who wants POi type search within the US the Bing API has a RESt service you can use:http://msdn.microsoft.com/en-us/library/dd250900.aspx

    Another option is to use the Navteq REST services.


    Windows Live Developer MVP - http://rbrundritt.wordpress.com | http://inknowledge.co.uk
    Wednesday, April 6, 2011 10:03 AM

All replies

  • a. Use map.setcenterandzoom function and reset your map extent to your geocoordinate as center of map

    b. Use below example which finds all POIs that suit given description with in current map extent


    <!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.2"></script>
          <script type="text/javascript">
          var map = null;
                
          function GetMap()
          {
             map = new VEMap('myMap');
             map.LoadMap();
          }   
             
          function FindNearby()
          {
             try
             {

                // Instead you can use  map.Find("Railway Station", null);
                map.Find(txtWhat.value, null);
             }
             catch(e)
             {
                alert(e.message);
             }
          }
          </script>
       </head>
       <body onload="GetMap();">
          <div id='myMap' style="position:relative; width:400px; height:400px;"></div>
          <input id="txtWhat" type="text" name="txtWhat" />
          <input id="find" type="button" value="Find" name="find" onclick="FindNearby();" />
       </body>
    </html>


    Aditya Tadakaluru MCPD, MCITP, MCTS(Bing Maps)
    Sunday, January 9, 2011 8:49 PM
  • Hi there,

    There is no REST search API, but you can use the SOAP Search Service.

    Since this is a topic that's come up a lot recently, I've just written a blog article that might help you:

    http://alastaira.wordpress.com/2011/01/09/the-bing-maps-soap-search-service/
    Beginning Spatial with SQL Server http://www.apress.com/book/view/1430218290
    Sunday, January 9, 2011 9:06 PM
    Moderator
  • For anyone who wants POi type search within the US the Bing API has a RESt service you can use:http://msdn.microsoft.com/en-us/library/dd250900.aspx

    Another option is to use the Navteq REST services.


    Windows Live Developer MVP - http://rbrundritt.wordpress.com | http://inknowledge.co.uk
    Wednesday, April 6, 2011 10:03 AM