address coordinates

Hello everyone,

does anyone know that if there is a function or a method that takes an address and returns the coordinates (either pixel x, y or latitude, longitude will do) of that address .. but without ploting the address on the map

thank you

Yuki


Answer this question

address coordinates

  • RayCan

    Sure. Download the SDK (http://go.microsoft.com/fwlink LinkID=23505). In the included samples, look in the Core Functionality\Find Address sample. I think that's the one, though it's been a while since I've messed with the samples.

    If you're geocoding a whole bunch of addresses, the BatchGeocodeSpecification might be more to your liking. Check out http://msdn.microsoft.com/library/default.asp url=/library/en-us/mappointsdk/html/M_Namespace_CustomerDataService_StartBatchGeocode.asp and http://msdn.microsoft.com/library/default.asp url=/library/en-us/mappointsdk/html/T_Namespace_BatchGeocodeSpecification.asp.


  • David Nielsen

    Or checkout these nice bit of code to do it using the seach behind local.live.com

    http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=776776&SiteID=1

    John.



  • issarto

    i am achieving this by combining the Google Earth API's geocoder method with VE for all display and markup.
    if you have a googleearth api key, you can do this easily.
    first load the geocoder:
    function loadGoogleMapAPI() {
    if (GBrowserIsCompatible()) {
    //add the google geocoder
    gcoder = new GClientGeocoder();
    }
    }//end function

    then do dosomething like this
    gcoder.getLocations(<some address>, createApprovalPinLatLong);

    your address is just an address (street num, city, state, zip, etc) and the second param is a function to handle the response. The response object is a JSON object that can be parsed like so:

    function createApprovalPinLatLong(response){
    if (!response || response.Status.code != 200) {
    alert("Sorry, we were unable to geocode that address");
    } else {
    place = response.Placemark[0];
    var myLat=place.Point.coordinates[1];
    var myLon=place.Point.coordinates[0];
    var latLong=myLat+","+myLon;
    //create your VE LatLong object
    var myVELatLon = new VELatLong(myLat,myLon);
    //pass the VElatlong object to the pin creator function
    createMyVEPin(myVELatLon);
    }

    mashing the mashups.


  • SPEEDY9123

    I see .. I could acctually get the coordinates from Find()'s call back fundtion with hiding the map while Find() is plotting to the map .. but the thing is when an address is not found, map.Find() would return a popup window says not found or closest address was found ..  do u know is there any way to detect address is not found or a closest address was returned in my call back function, so i can alert my own message


    Thanks very much

  • Lhheah

    You can't do this in VE right now--all place finds result in the adress getting shown on the map. You can use the MapPoint Web Service to this, however.


  • Rocky79

    Hi Caleb T,

    Have you got any example code as too how to achieve this using MapPoint Web Service

    Regards,

    John


  • address coordinates