none
Service finder RRS feed

  • Question

  • Hi all,

    I am trying to develop an application where the user is able to find a service/store in a particular city/state/zipcode. (For example, yelp.com or simple bing search for "Safeway near Santa Clara"). The search should return the listings as found on bing search.

    I am developing using javascript. So far I am able to just find an actual address using BING MAPS AJAX 7.0 Control API. Can anybody please further direct me what I should be using next. Any links to blogs or examples will be of great help. Thanks.

    Sincerely,

    Sonal.

     

    • Moved by Ricky_Brundritt Friday, March 9, 2012 1:40 PM (From:Bing Maps: Map Control and Web services Development)
    Monday, January 3, 2011 7:09 PM

Answers

  • Use VEMap.Find function - http://msdn.microsoft.com/en-us/library/bb429645.aspx.

    For example

    I'm just copy pasting the same example here for your reference
    <!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 Find()
          {
             try
             {
                map.Find(txtWhat.value, txtWhere.value);
             }
             catch(e)
             {
                alert(e.message);
             }
          }
          </script>
       </head>
       <body onload="GetMap();">
          <div id='myMap' style="position:relative; width:400px; height:400px;"></div>
          <div>What:<input id="txtWhat" type="text" name="txtWhat" /></div>
             <div>Where:<input id="txtWhere" type="text" name="txtWhere" />
             <input id="find" type="button" value="Find" name="find" onclick="Find();" />
          </div>
       </body>
    </html>
    Hope this helps. Please let me know if you have any questions.

    Aditya Tadakaluru MCPD, MCITP, MCTS(Bing Maps)
    • Marked as answer by sonal.breed Tuesday, January 4, 2011 6:31 PM
    Tuesday, January 4, 2011 5:16 PM
  • URL looks good to me.
    Aditya Tadakaluru MCPD, MCITP, MCTS(Bing Maps)
    • Marked as answer by sonal.breed Tuesday, January 4, 2011 6:31 PM
    Tuesday, January 4, 2011 6:21 PM

All replies

  • Use VEMap.Find function - http://msdn.microsoft.com/en-us/library/bb429645.aspx.

    For example

    I'm just copy pasting the same example here for your reference
    <!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 Find()
          {
             try
             {
                map.Find(txtWhat.value, txtWhere.value);
             }
             catch(e)
             {
                alert(e.message);
             }
          }
          </script>
       </head>
       <body onload="GetMap();">
          <div id='myMap' style="position:relative; width:400px; height:400px;"></div>
          <div>What:<input id="txtWhat" type="text" name="txtWhat" /></div>
             <div>Where:<input id="txtWhere" type="text" name="txtWhere" />
             <input id="find" type="button" value="Find" name="find" onclick="Find();" />
          </div>
       </body>
    </html>
    Hope this helps. Please let me know if you have any questions.

    Aditya Tadakaluru MCPD, MCITP, MCTS(Bing Maps)
    • Marked as answer by sonal.breed Tuesday, January 4, 2011 6:31 PM
    Tuesday, January 4, 2011 5:16 PM
  • Hi Aditya,

    The above example was of great help. Thanks a lot :) I just had one more small question:

    I also want to have the link to be secure. So I used following URL:

    https://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2&s=1

     

    It is working fine, I just want to confirm it again. Thanks.

    Sincerely,

    Sonal.

    Tuesday, January 4, 2011 6:07 PM
  • URL looks good to me.
    Aditya Tadakaluru MCPD, MCITP, MCTS(Bing Maps)
    • Marked as answer by sonal.breed Tuesday, January 4, 2011 6:31 PM
    Tuesday, January 4, 2011 6:21 PM
  • Hello Sonal

    Sorry I didn't notice this early. For Bing maps V7 the securied url should look like

    https://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&s=1


    Aditya Tadakaluru MCPD, MCITP, MCTS(Bing Maps)
    Tuesday, January 4, 2011 6:44 PM