• geocoding with virtual earth and windows forms


    there's been some questions to me and in my local community about my vague references to my geocoder provider (sorry andrew).  the demonstration/explanation of that provider is here in my "geocode provider" post (not sure why i didn't make that part of the code gallery originally, apologies -- it now is).  i hope that helps.

    i've also just uploaded an example of how you can use virtual earth for geocoding...i've wrapped it in a windows forms app to show that you can leverage virtual earth in a windows forms application as well.  i hope that helps.

    basically what happens is the form calls a script:

       1:  private void button1_Click(object sender, EventArgs e)
       2:  {
       3:      AddPushpin.Visible = false;
       4:      executeScript(ClearAllPushpins);
       5:      executeScript(FindLocation, LocationToFind.Text);
       6:  }


    on the html page implementing the map rendering, i have a callback function that calls back into my winforms, providing the latlong:

       1:  function OnFoundLocation(e)
       2:  {
       3:      if (e.length > 0)
       4:      {
       5:          var latLon = e[0].LatLong;
       6:          window.external.LocationFound(latLon.Latitude, latLon.Longitude);
       7:      }
       8:  }


    File: Virtual Earth Geocode in WinForms

    Saturday, February 03, 2007 4:47 PM

    PostTypeIcon

Comments.

  • Ed said:
    Gravatar
    # re: geocoding with virtual earth and windows forms


    Nice sample, well done. I can think of dozens of uses...

    7/18/2007 1:01 PM

Your Reply.

  Comment Form  

Fields denoted with a "*" are required.

*Your name:
Subject:
Your blog:
Your email:  (will not be displayed)
*Your message:

 
Please add 2 and 6 and type the answer here: