Geoffrey Emery
Tech Goodness

Windows 7 fix forVirtual Earth 3D

January 22, 2009 07:04 by gemery

If you’ve tried installing Virtual Earth 3D on Windows 7 you may have see a little problem with the installer crashing during setup stating, “Virtual Earth 3D Install has stopped working.” CP over at the VE Team to the rescue!

image

As it turns out there’s an issue with the Software Quality Metrics (SQM) in Windows 7 that it doesn’t like VE 3D. If you want to get it working, you’ll need to make a manual registry change. The fix is actually quite simple – just rename (or delete) the following key:

HKLM\Software\Microsoft\SQMClient\Windows\DisabledSessions

Once you’ve done that, run the install again and it should work without issue.

Technorati Tags: ,

Virtual Earth Web Service - Get Server Tile Information

January 21, 2009 23:35 by gemery

In this tutorial we are going to look at what you need to get Tile information from a lat Lat Long(GeoCode) 

First a picture of what the final project will look like.

image

Note:

You must!  change the username in the web.config

    <add key="VEUsername" value="YourKey"/>
    <add key="VEPassword" value="YourPassword"/>

with your own information

image

1) Learn about Tokens

Okay, so, first things first, you need to authenticate - see my post Authentication and Tokens with Virtual Earth for authentication.

 

2) Create  AJAX Website in VS

Now that you are dialed in with your virtual earth tokens we are going to dive right into the web services. Lets go ahead and create a web site in VS. I am going to spice this up a bit and make it Ajax enabled. So go ahead and install AJAX or if you are using VS2008 sp 1 you should be already cool. Through in a script manager down and a update panel, and a update progress manager down on the page. This is the web form should look like in between the body tags should look this now.

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1" DisplayAfter="5">
           <ProgressTemplate>
              
           </ProgressTemplate>
       </asp:UpdateProgress>
       <asp:UpdatePanel ID="UpdatePanel1" runat="server">
           <ContentTemplate>
     
           </ContentTemplate>
       
       </asp:UpdatePanel>

 

3) Fill in the UI

The full default.aspx page

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml">
 <head id="Head1" runat="server">
    <title>VE Web Services Imagery Tile Sample</title>
</head>
<body style="font-family:Arial; font-size:small">
    <form id="form1" runat="server">
    <div style="font-weight:bold">
        VE Web Services Imagery Tile Sample
    </div>
    <br />
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1" DisplayAfter="20">
            <ProgressTemplate>
                <img alt="updatepannel" src="Images/Update.gif" />
            </ProgressTemplate>
        </asp:UpdateProgress>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                Latitude: <asp:TextBox runat="server" ID="TextBox_Latitude" Width="125" />
                Longitude: <asp:TextBox runat="server" ID="TextBox_Longitude" Width="125" />
                Zoom Level: <asp:DropDownList runat="server" ID="DropDownList_ZoomLevel" />
                <br />
                <asp:Button runat="server" Text="Load Tile" ID="Button_LoadTile" 
                    onclick="Button_LoadTile_Click" />
                <br /><br />
                <div runat="server" id="Div_Info" />
                <asp:PlaceHolder runat="server" ID="PlaceHolder_MapImages" />
            </ContentTemplate>
        </asp:UpdatePanel>
    
    </div>
    </form>
</body>
</html>

4) Add the token to the web.config

<appSettings>
<!--
  This username and password is supplied for demo purposes only.  Please do not use this account for 
  anything other than this demo.  This account is monitored very closely and will be deactivated if used improperly
  To get your own Virtual Earth account, go to https://mappoint-css.live.com/MwsSignup/.
-->
<add key="VEUsername" value="YourToken"/>
<add key="VEPassword" value="YourPassword"/>
 
appSettings>

5) Add the Utility Class

You can do this as you like. I like to keep it separate. This takes the user key and password out of the web.config and news up a new VECredential for you

using System.Net;
using VEAuthenticationService;
using System.Text.RegularExpressions;
using System.Configuration;
    public static class Utils
    {
        private static string GetVEUsername() { return ConfigurationManager.AppSettings["VEUsername"].ToString(); }
        private static string GetVEPassword() { return ConfigurationManager.AppSettings["VEPassword"].ToString(); }
 
        public static string StripHTMLTags(string HtmlToStrip)
        {
            return Regex.Replace(HtmlToStrip, @"<(.|\n)*?>", string.Empty);
        }
 
        /// <summary>Returns a token from the Virtual Earth web service</summary>
        public static string Token(string ClientIP)
        {
            // This token will expire so that should be handled appropriately
            
                // Create a CommonService so we can make the request
                CommonService commonService = new CommonService
                {
                    // Supply your Virtual Earth credentials
                    // to get a Virtual Earth developer account, go to https://mappoint-css.live.com/MwsSignup/
                    Credentials = new NetworkCredential(Utils.GetVEUsername(), Utils.GetVEPassword())
                };
 
                // Create a token specification
                TokenSpecification tokenSpecification = new TokenSpecification
                {
                    // Token will expire in 60 minutes, max is 480 minutes
                    TokenValidityDurationMinutes = 60,
                    // Supply the client's IP address
                    ClientIPAddress = ClientIP
                };
                return commonService.GetClientToken(tokenSpecification);
          }
    }
 
 
 
 
 
 
 
 

6) Add the Update Image of your choice to to images folder for the update panel progress bar. –> this might make more sense after you download the project

7) add  your web service reference

Add a web service by right clicking on the project

image 

Imagery Service

http://dev.virtualearth.net/webservices/v1/imageryservice/imageryservice.svc?wsdl

8) Add the Guts

Now we add the GUTS to the code behind of the default.aspx page

First I am going to load the page up with some default values for testing purposes

Now for the fun stuff Getting the map from Microsoft

/// <summary>Loads a tile map tile that contains the specified latitude and longitude</summary>
   /// <param name="sender">The sender</param>
   /// <param name="e">Event arugments</param>
   protected void Button_LoadTile_Click(object sender, EventArgs e)
   {
       // Clear our outputs before we start.
       this.PlaceHolder_MapImages.Controls.Clear();
       this.Div_Info.InnerHtml = "";
 
       // Create a ImageryMetadataOptions object
       ImageryMetadataOptions imageryMetadataOptions = new ImageryMetadataOptions
       {
           // Specify the location, this will not necessarly be the middle of the tile
           Location = new Location
           {
               Altitude = 0,
               Latitude = Convert.ToDouble(this.TextBox_Latitude.Text),
               Longitude = Convert.ToDouble(this.TextBox_Longitude.Text)
           },
           ReturnImageryProviders = true,
           ZoomLevel = Convert.ToInt32(this.DropDownList_ZoomLevel.SelectedItem.ToString()),
       };
 
       // Create the metadata request, set the credentials, options and a map style
       ImageryMetadataRequest imageryMetadataRequest = new ImageryMetadataRequest
       {
           //add the metadata options object from above
           Options = imageryMetadataOptions,
           Style = MapStyle.AerialWithLabels
       };
 
       //New up a credentials object and set the token
       imageryMetadataRequest.Credentials = new VEImageryService.Credentials();
       imageryMetadataRequest.Credentials.Token = Utils.Token(Request.UserHostAddress);
 
       // Create the ImageryServiceClient
       ImageryServiceClient imageryServiceClient = new ImageryServiceClient();
 
       //and make the request
       ImageryMetadataResponse imageryMetadataResponse = imageryServiceClient.GetImageryMetadata(imageryMetadataRequest);
 
       // Write out the tile metadata to the UI
       foreach (ImageryMetadataResult imageryMetadataResult in imageryMetadataResponse.Results)
       {
           Image image = new Image();
           image.ImageUrl = imageryMetadataResult.ImageUri;
           this.PlaceHolder_MapImages.Controls.Add(image);
 
           this.WritePair("Image URI", imageryMetadataResult.ImageUri);
           if (imageryMetadataResult.Vintage != null)
           {
               this.WritePair("Vintage From", imageryMetadataResult.Vintage.From.ToString());
               this.WritePair("Vintage To", imageryMetadataResult.Vintage.To.ToString());
           }
           this.WritePair("Zoom Range From", imageryMetadataResult.ZoomRange.From.ToString());
           this.WritePair("Zoom Range To", imageryMetadataResult.ZoomRange.To.ToString());
           this.WriteInfo("");
       }
   }

And finally add a handler for the button click

/// <summary>Writes a name/value pair to the UI, name is bolded.</summary>
    /// <param name="name">Name of the name/value pair</param>
    /// <param name="value">Value of the name/value pair</param>
    protected void WritePair(string name, string value)
    {
        this.WriteInfo("<B>" + name + ":</B> " + value);
    }
 
    /// <summary>Writes information to the UI</summary>
    /// <param name="html">HTML to write to the UI</param>
    protected void WriteInfo(string html)
    {
        this.Div_Info.InnerHtml += html + "<br/>\n";
    }

and Bam there you have a map coming at you from a longitude latitude and you are spitting out the the map tiles information.

If you need to do this from a address look at this example.

http://blog.geoffreyemery.com/post/Virtual-Earth-Web-Services----GeoCoding-and-Reverse-GeoCoding.aspx

After you geocode it you can then send in another request to get a map.

Download the code here.

image

One Last look at the finished Product

image


Virtual Earth Web Services - GeoCoding and Reverse GeoCoding

January 21, 2009 22:11 by gemery

In this tutorial we are going to look at what you need to go from a a Address to a Lat Long(GeoCode) and from a Lat Long to a Address(reverse geocode)

First a picture of what the final project will look like.

image

Note:

You must!  change the username in the web.config

    <add key="VEUsername" value="YourKey"/>
    <add key="VEPassword" value="YourPassword"/>

with your information

image

 

1) Learn about Tokens

Okay, so, first things first, you need to authenticate - see my post Authentication and Tokens with Virtual Earth for authentication.

 

2) Create a blank AJAX project in VS

Now that you are dialed in with your virtual earth tokens we are going to dive right into the web services. Lets go ahead and create a blank project in VS

3) Add the UI

I am going to spice this up a bit and make it Ajax enabled. So go ahead and install AJAX or if you are using VS2008 sp 1 you should be already cool. So go ahead and through a script manager down and a update panel, and a update progress manager down on the page. This is the web form should look like in between the body tags should look this now.

 

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1" DisplayAfter="5">
           <ProgressTemplate>
              
           </ProgressTemplate>
       </asp:UpdateProgress>
       <asp:UpdatePanel ID="UpdatePanel1" runat="server">
           <ContentTemplate>
     
           </ContentTemplate>
       
       </asp:UpdatePanel>

4 ) Add page propeties

Now are going to add our table to the update content template

<table border="1">
                    <tr>
                        <td valign="top">
                            Address: <asp:TextBox runat="server" ID="TextBox_Address" Width="250" />
                            <br />
                            <asp:Button runat="server" Text="Geocode" ID="Button_Geocode" 
                                onclick="Button_Geocode_Click" />
                        </td>
                        <td>
                            Latitude: <asp:TextBox runat="server" ID="TextBox_Latitude" Width="250" />
                            <br />
                            Longitude: <asp:TextBox runat="server" ID="TextBox_Longitude" Width="250" />
                            <br />
                            <asp:Button runat="server" Text="Reverse Geocode" ID="Button_ReverseGeocode" 
                                onclick="Button_ReverseGeocode_Click" />
                        </td>
                    </tr>
                </table>
                <br />

then add a div we are going to inject our information that we get back from Virtual Earth

<div runat="server" id="Div_Info" />

 

5) Add a web reference to the VE Geocode Service

Now are going to add a web reference to the VE Geocode Service

This is the address at the time of writing this article


http://staging.dev.virtualearth.net/webservices/v1/geocodeservice/geocodeservice.svc?wsdl

In our service refrence we now will have something that looks like this

image

Sweet that was easy.

6) Add a Utility class

Now that we have that we need to add a Utility class that will take our developer credentials and get us a token so we can start making requests against the web service api..

Here is a great  class for doing that.. I named it Utils.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Net;
using System.ServiceModel;
using VEWebServicesDemo.VEAuthenticationService;
using VEWebServicesDemo.VEGeocodeService;
using System.Configuration;
using System.Collections;
using System.Text.RegularExpressions;
 
namespace VEWebServicesDemo
{
    public static class Utils
    {
        private static string GetVEUsername() { return ConfigurationManager.AppSettings["VEUsername"].ToString(); }
        private static string GetVEPassword() { return ConfigurationManager.AppSettings["VEPassword"].ToString(); }
 
        public static string StripHTMLTags(string HtmlToStrip)
        {
            return Regex.Replace(HtmlToStrip, @"<(.|\n)*?>", string.Empty);
        }
 
        /// <summary>Returns a token from the Virtual Earth web service</summary>
        public static string Token(string ClientIP)
        {
            // This token will expire so that should be handled appropriately
            
                // Create a CommonService so we can make the request
                CommonService commonService = new CommonService
                {
                    // Supply your Virtual Earth credentials
                    // to get a Virtual Earth developer account, go to https://mappoint-css.live.com/MwsSignup/
                    Credentials = new NetworkCredential(Utils.GetVEUsername(), Utils.GetVEPassword())
                };
 
                // Create a token specification
                TokenSpecification tokenSpecification = new TokenSpecification
                {
                    // Token will expire in 60 minutes, max is 480 minutes
                    TokenValidityDurationMinutes = 60,
                    // Supply the client's IP address
                    ClientIPAddress = ClientIP
                };
                return commonService.GetClientToken(tokenSpecification);
          }
    }
}

Great so we have our auth service and we have our credentials class lets get into the fun stuff.

7) Give it Guts

Now have our front end our data access layer lets set up the middlish tier

First thing I am going to do is load up the page with some default values in the page_load so that when i demo this it I can click and show .

protected void Page_Load(object sender, EventArgs e)
   {
       // Set a default address to search for.
       if (this.IsPostBack == false)
       {
           // Default for the address box
           this.TextBox_Address.Text = "1313 S Figueroa St, Los Angeles, California 90015, United States";
 
           //LACC
           this.TextBox_Latitude.Text = "34.0404";
           this.TextBox_Longitude.Text = "-118.2688";
 
       }
   }

 

Next I am going to add functionality to the button to get a gecode from a address all information on the function are in the comments

/// <summary>Geocodes the address specified in the UI</summary>
       /// <param name="sender">The sender</param>
       /// <param name="e">Event arguments</param>
       protected void Button_Geocode_Click(object sender, EventArgs e)
       {
           // Clear any existing data from our div
           this.Div_Info.InnerHtml = "";
 
           GeocodeRequest geocodeRequest = new GeocodeRequest();
           
           // Create a new Credential object and provide the token
           geocodeRequest.Credentials = new VEGeocodeService.Credentials();
           geocodeRequest.Credentials.Token = Utils.Token(Request.UserHostAddress);
 
           // Set the address from the UI on the request
           geocodeRequest.Query = this.TextBox_Address.Text.Trim();
 
           // Create a new geocode client
           GeocodeServiceClient geocodeServiceClient = new GeocodeServiceClient();
 
           // Execute the geocode request
           GeocodeResponse geocodeResponse = geocodeServiceClient.Geocode(geocodeRequest);
 
           // Iterate through each of the results and send write some data to the UI
           foreach (GeocodeResult geocodeResult in geocodeResponse.Results)
           {
               this.WritePair("Formatted Address", geocodeResult.Address.FormattedAddress);
               this.WritePair("Display Name", geocodeResult.DisplayName);
               this.WritePair("Confidence", geocodeResult.Confidence.ToString());
 
               // Iterate through each location within the result and send back the Lat/Long
               foreach (GeocodeLocation geocodeLocation in geocodeResult.Locations)
               {
                   this.WritePair("Calculation Method", geocodeLocation.CalculationMethod);
                   this.WritePair("Longitude", geocodeLocation.Latitude.ToString());
                   this.WritePair("Latitude", geocodeLocation.Longitude.ToString());
               }
               this.WriteInfo("");
           }
       }

I am going to add the reverse geocode functionality

 

/// <summary>Reverse geocodes the latatitude and longitude specified in the UI</summary>
        /// <param name="sender">The sender</param>
        /// <param name="e">Event arguments</param>
        protected void Button_ReverseGeocode_Click(object sender, EventArgs e)
        {
            // Clear any existing data from our div
            this.Div_Info.InnerHtml = "";
 
            //Create a new ReverseGeoCode Request object
            ReverseGeocodeRequest reverseGeocodeRequest = new ReverseGeocodeRequest();
 
            // Create a new Credential object and provide the token
            reverseGeocodeRequest.Credentials = new VEGeocodeService.Credentials();
            reverseGeocodeRequest.Credentials.Token = Utils.Token(Request.UserHostAddress);
 
            //New a VEGeocode Location object and set it's properties
            reverseGeocodeRequest.Location = new Location
            {
                Latitude = Convert.ToDouble(this.TextBox_Latitude.Text),
                Longitude = Convert.ToDouble(this.TextBox_Longitude.Text)
            };
 
            // New up a new GeocodeServiceClient to make our request with
            GeocodeServiceClient geocodeServiceClient = new GeocodeServiceClient();
 
            // Execute the ReverseGeocode request
            GeocodeResponse geocodeResponse = geocodeServiceClient.ReverseGeocode(reverseGeocodeRequest);
 
            // Write out the response information to the UI
            foreach (GeocodeResult geocodeResult in geocodeResponse.Results)
            {
                this.WritePair("Display Name", geocodeResult.DisplayName);
                this.WritePair("Entity Type", geocodeResult.EntityType);
                this.WritePair("Confidence", geocodeResult.Confidence.ToString());
                this.WritePair("Address Line", geocodeResult.Address.AddressLine);
                this.WritePair("Locality (city)", geocodeResult.Address.Locality);
                this.WritePair("Admin District (state)", geocodeResult.Address.AdminDistrict);
                this.WritePair("Postal Code", geocodeResult.Address.PostalCode);
                this.WriteInfo("");
            }
        }

 

A couple of little helper functions

// <summary>Writes a name/value pair to the UI, name is bolded.</summary>
        /// <param name="name">Name of the name/value pair</param>
        /// <param name="value">Value of the name/value pair</param>
        protected void WritePair(string name, string value)
        {
            this.WriteInfo("<B>" + name + ":</B> " + value);
        }
 
        /// <summary>Writes information to the UI</summary>
        /// <param name="html">HTML to write to the UI</param>
        protected void WriteInfo(string html)
        {
            this.Div_Info.InnerHtml += html + "<br/>\n";
        }
    }

And Bam we have a working demo. 7 Steps to Virtual Earth Web Services.

Here is a shot of the what the reverse geocode spits out

image 

image

Have Fun!


Virtual Earth Web Services - Using HTTPS Secure Socket Layer (SSL) Protocol

January 21, 2009 21:45 by gemery
If you want to send and receive Virtual Earth Web Services requests using Secure Socket Layer (SSL), follow the steps below.

Follow this post to get you token

http://blog.geoffreyemery.com/post/Virtual-Earth-Web-Services---Requesting-a-Token.aspx

Follow this post to find web services

http://blog.geoffreyemery.com/post/Virtual-Earth-Web-Services.aspx

 

  1. Generate proxy classes using the staging or production service metadata URLs listed above by adding a service reference using the Visual Studio User Interface or by using the svcutil.exe tool. More information about this is found in the Generating Client Proxy Classes topic.
  2. Edit the service endpoint address URLs found in your configuration file to begin with "https" instead of "http".
  3. If you are using Visual Studio 2008 and the .NET Framework 3.0, you also need to change the BasicHttpSecurityMode to Transport. To do this, either set the mode of the security tag in your Visual Studio 2008 configuration file to Transport, or initialize your service variable with this security mode.

Add this to the config

<!-- Visual Studio 2008 configuration settings for SSL -->
<system.serviceModel>
   <bindings>
      <basicHttpBinding>
         <binding name="BasicHttpBinding_IImageryService" closeTimeout="00:01:00"
            openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
            allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
            maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
            messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
            useDefaultWebProxy="true">
            <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
            <security mode="Transport">
               <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
               <message clientCredentialType="UserName" algorithmSuite="Default" />
            </security>
         </binding>
      </basicHttpBinding>
   </bindings>
   <client>
      <endpoint address="https://staging.dev.virtualearth.net/WebServices/v1/ImageryService/ImageryService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IImageryService" contract="IImageryService" name="BasicHttpBinding_IImageryService" />
   </client>
</system.serviceModel>

 

// Instead of setting the security mode in the configuration file, 
//    initialize the service client variable with the Transport
//    security mode.
SearchServiceClient client = new SearchServiceClient(new BasicHttpBinding(BasicHttpSecurityMode.Transport), new EndpointAddress("https://staging.dev.virtualearth.net/webservices/v1/searchservice/searchservice.svc");
 
 
 
 

MSDN Refrence


Virtual Earth Web Services

January 21, 2009 21:40 by gemery

Ok this a repost but ill be dammed if I try to find it one more time on microsofts site so I posting it here for SEO sake.

To call one of the Virtual Earth Web Services, you need to generate proxy classes on your client. This is described in detail in the Generating Client Proxy Classes topic. If you are using Visual Studio 2008, use the svcutil.exe command-line utility (http://msdn.microsoft.com/en-us/library/aa347733.aspx) or add service references to the Virtual Earth Web Services from the Visual Studio user interface. The Virtual Earth Web Services metadata defines the format of messages that the Virtual Earth Web Services send and receive.

You can use either the standard HTTP protocol or the HTTPS Secure Sockets Layer (SSL) protocol to call the Virtual Earth Web Services. Note that using the SSL protocol adds latency for each call to the Virtual Earth Web Services. The latency duration depends on how the SSL infrastructure is implemented on your servers; the minimum additional latency is five milliseconds.

Virtual Earth provides both staging and production environments, which are two functionally identical, yet separate, service environments.

Staging Environment

The Virtual Earth Web Services staging environment is a testing environment that is separate from, but complementary to, the production environment that you use when your application goes live. You can use the staging environment to prototype, develop, and test new applications.

Note The staging environment is not scaled for the volumes that the production environment is designed to provide. Any application stress or performance testing is limited to a certain number of requests per second and time of day.

The following table lists the staging service metadata URLs for each of the Virtual Earth Web Services. Note that you will need to have valid credentials to make staging service calls. More information about getting and setting credentials can be found in the Accessing the Virtual Earth Web Services topic.

Service Name
Staging Service Metadata URL

Geocode Service

http://staging.dev.virtualearth.net/webservices/v1/geocodeservice/geocodeservice.svc?wsdl

Imagery Service

http://staging.dev.virtualearth.net/webservices/v1/imageryservice/imageryservice.svc?wsdl

Route Service

http://staging.dev.virtualearth.net/webservices/v1/routeservice/routeservice.svc?wsdl

Search Service

http://staging.dev.virtualearth.net/webservices/v1/searchservice/searchservice.svc?wsdl

Production Environment

The Virtual Earth Web Services production environment is fully scaled for all Virtual Earth customers. You use this environment when your application is made available to the public through the Internet, including live, beta, evaluation, and prerelease types of applications.

Note Activity in the production environment is billable. Do not use the production environment for performance and stress testing beyond your expected volumes.

The following table lists the production service metadata URLs for each of the Virtual Earth Web Services. Note that you will need to have valid credentials to make production service calls. More information about getting and setting credentials can be found in the Accessing the Virtual Earth Web Services topic.

Service Name
Production Service Metadata URL

Geocode Service

http://dev.virtualearth.net/webservices/v1/geocodeservice/geocodeservice.svc?wsdl

Imagery Service

http://dev.virtualearth.net/webservices/v1/imageryservice/imageryservice.svc?wsdl

Route Service

http://dev.virtualearth.net/webservices/v1/routeservice/routeservice.svc?wsdl

Search Service

http://dev.virtualearth.net/webservices/v1/searchservice/searchservice.svc?wsdl

 


Virtual Earth Web Services - Requesting a Token

January 21, 2009 21:34 by gemery

Once you starting to get serious about virtual earth you are going to need to get a token.

Token information is required mainly for two reasons –

· Identify the account ID using the VE Platform API for logging, reporting and billing purposes.

· Provide a reasonable level of protection against fraudulent transactions for our paying customers and ourselves.

This is how you do it.

  1. Get a Windows Live ID at https://login.live.com. If you already have a Windows Live ID, you can use it instead of creating a new one.
  2. Sign up for a Virtual Earth Platform developer account. Go to https://mappoint-css.live.com/mwssignup and sign up for a free evaluation developer account.
  3. Once you have received account creation confirmation email, you can manage your Virtual Earth Platform developer account on the Virtual Earth Platform Customer Services site. You use your Windows Live ID to log in to the Customer Services site , and if its your first time it will ask you to change your password. This will essentially lock you out for up to two hours but sometimes it works faster. I found that i was confused with which number was my token so make sure you use the one in the email that is the token that you should use to get your VE Credential.
  4. On the Manage Account page of the Virtual Earth Platform Customer Services site you will find your Account ID. The Manage Password page allows you to set the password for this account ID.
  5. If you are using Visual Studio to build your application, then in your web application project add a web reference to the staging or production Virtual Earth Token Service
  6. Set your account ID and account password in the Credentials property of the CommonServiceSoap Class before making requests to the Virtual Earth Token Service using the CommonServiceSoap.GetClientToken Method.
  7. The CommonServiceSoap.GetClientToken Method returns a string, which is the Virtual Earth Token. This token can be used in your Virtual Earth Web Services or Virtual Earth Map Control application.

 

Woot you watied two hours and now your ready to use your token and password

Token Service URLs

Virtual Earth provides a staging environment to test your application and a production environment to use once you have become a licensed customer.

Staging Environment

https://staging.common.virtualearth.net/find-30/common.asmx?wsdl

Note Developer evaluation accounts only have access to the Staging environment.

Production Environment

https://common.virtualearth.net/find-30/common.asmx?wsdl

To access the Production environment, you must be a licensed customer. Contact the Microsoft Virtual Earth Licensing Team for more information.

Note Activity in the production environment is billable. For more information about Billable Transactions, see the Viewing Virtual Earth Transaction Reports topic.

Adding the Token Service as a Visual Studio Web Reference

The steps below outline adding a web reference to the Token Service from your Visual Studio project.

  1. Launch the Add Web Reference dialog. Select the Add Web Reference item from either the Project menu or the contextual menu for the project in the Solution Explorer.

    If you are using Visual Studio 2008 and Add Web Reference is not present in either the Project menu or the contextual menu for the project, do the following:

  2. image_thumb21 

  3. image_thumb4 

  4. Enter either the staging or production Token Service URL from above for the Url and click Go.
  5. When prompted, enter your Virtual Earth Developer Account ID and Password. This is usally like 3 –5 times so have it ready to cut and paste
  6. Once the WSDL has been downloaded, give the web reference a name such as "TokenService". Click Add Reference.

Now go read some of my virtual earth web service tutorials and you can rock it!

Bam your tokenized. Now all you have to do is grab the services you want and start programming against them. Have fun!


Virtual Earth 3D Awesomeness!

January 9, 2009 09:23 by gemery

This is just to freaking awesome! You have to check out this video from Dan at Channel and download and use this code immediately at Coding for Fun.

Brian Peek demonstrates how to use a Nintendo Wii Remote (Wiimote), a Wii Fit Balance Board, and Vuzix VR920 glasses as input devices for Microsoft Virtual Earth 3D, providing a fully immersive, 3D experience.

Get Microsoft Silverlight

Technorati Tags:

Track Santa On the Virtual Earth

December 24, 2008 08:53 by gemery

Great Post From the VE Team Re-Posted Here

As a follow up to The North Pole – A Virtual Earth Christmas Experience, the VE Team created a Santa Tracker to track Old St. Nick on his trek around the world hosted by MSNBC (direct link to application here in the case you can find it on MSNBC). As Ed Young would say, “we’re gonna take this to a whole ‘notha level.”

Santa, leaving The North Pole

Quite literally, in fact. Because this Santa tracker is updated dynamically and Santa’s sleigh is elevated to illustrate his magical flying capabilities – not to mention the elves worked extra hard to change the pushpin blip on a map into a 3-Dimensional object inclusive with real reindeer (Rudolph leading the pack), Santa himself and a bag full of presents. After all, they are more than just a blip on the map now aren’t they?

New York City

If you aren’t sure how to navigate the application, some brief instructions are provided for you.

clip_image001To locate Santa along his delivery route in Microsoft Virtual Earth 3D, you will need to install the Virtual Earth 3D plug-in in order to view it.  If you do not have this plug-in, you will be prompted to install it when the page loads.  If your pop-up blocker disables this prompt, you can download the plugin here.

This experience may take up to a minute to load on your screen.  Once Santa has been tracked, you will see the an alert that “Santa has been located!”

clip_image003Click on the “OK” button to zoom in on Santa flying over his current location. Keep an eye on the page load status indicated by the Virtual Earth globe icon in the bottom right corner of the screen. The page is fully loaded when the globe is completely colored.

clip_image005Use the Virtual Earth tool bar to zoom, pan or tilt the page to see Santa, his sleigh and reindeer from different angles in 3D and to explore the location over which he is traveling.

Virtual Earth 3D requires the following to run on your computer:

    • Microsoft Windows XP or Microsoft Windows Vista

    • Microsoft Internet Explorer 6, Windows Internet Explorer 7 or later, or Firefox 2.0 or later

    • 250 MB or more hard disk space

    • A 1 GHz processor (2.8 GHz or faster recommended)

    • 256 MB of system memory (1 GB recommended)

    • 32 MB video card (256 MB recommended) that supports Microsoft DirectX 9

    • A high speed or broadband Internet connection

Cruising my home town of San Diego

So, enjoy the holidays. Check on Santa’s progress by frequenting the Santa Tracker hosted by MSNBC. He’ll be at the North Pole until midnight tonight and then begin his journey around the world. Wait! Tonight at midnight??? Yep. Those of you inside the first time zone by the international date line aren’t surprised, are you? Everyone else, see the complexity? 

Great Post Team VE!

Technorati Tags: ,

New Version of Virtual Earth Intellisense helper released!

October 12, 2008 07:39 by gemery

This might be old news to some but hey I am on the road and I can barely get sleep rather then keep up at h some of this stuff.  I just wanted to let everyone know to download the new intellesense helper so that it will work with the new 6.2 version of VE.

image


Virtual Earth 6.2 and Virtual Earth Web Services 1.0 Released

October 10, 2008 13:53 by gemery
Well the VE team is still very busy at work I and have realease yet another awsome sub version of VE.Check out all the new specks from mark brown

 

  • Maps for Mobile Devices. Develop mobile applications with rich imagery optimized specifically for mobile devices, including the iPhone. The new mobile-optimized features are supported in the new Virtual Earth Web Services.
  • Bird’s Eye Views and Bird’s Eye Hybrid. Exclusive to Microsoft, these unique views of real-world locations provide insight into “what it’s like there.” Bird’s eye hybrid adds street names to the bird’s eye maps to provide end users better visual context and orientation.
  • Aerial Imagery. Leverage the impact of high-resolution aerial images from leading imagery providers.
  • 3D Imagery. Create more realistic 3D views of buildings and landscapes, featuring denser city models.
  • Geocoding and Reverse Geocoding. Get the most accurate locations around the world through integration of multiple geocoders and datasets with MapView, Reverse IP, and Culture to provide the most relevant and accurate results. And find the closest street address based only on latitude and longitude coordinates from a GPS or other geospatial device.
  • International Geocoding. Your customers can now find international addresses with reverse geocoding, available anywhere Virtual Earth has routing.
  • Localized Directions. Get localized driving or walking directions in 15 languages.
  • Localized Maps. Create better connections with your global customers. Provide localized maps in U.S. English, German, French, Spanish, and Italian in Western Europe.
  • Extended International Parsing Capabilities. Users will experience better match rates for addresses in Australia, New Zealand, Canada, and Puerto Rico.
  • Expanded Number of Rooftop Views. Provide more detailed maps to help users find locations with rooftop accuracy. Virtual Earth now offers 85 million unique addresses—more than 70 percent of all rooftops in the U.S.
  • Near-Matching Capabilities. using alternate and similar spellings, resulting in a more relevant search experience.
  • Imagery Metadata. Users can now find out the relative age of a given aerial image. This level of detail will help them assess if the imagery is relevant to their needs.
  • New Virtual Earth Web Services. Developers can now take advantage of the new Virtual Earth Web Services API, which offers static map images (.gif, .jpeg, and .png), direct map tile access, one-box search functionality, geocoding, reverse geocoding, and routing.
  • One-Click Directions. From your Virtual Earth Web application, allow your customers to get directions in one click, choosing from route options by shortest time, shortest distance, or traffic flow. With one-click directions, users instantly get directions without having to enter a starting address.
  • Shapes and Shape Layers. Customize and modify pushpins, polylines and polygons, line colors and widths, and transparencies of shapes, as well as add custom icons.
  • Pushpin Clustering. Provide customers the ability to zoom in on a map to better visualize a cluster of points. When many locations exist in a dense area, the pushpins can be clustered or hidden from view at smaller zoom levels.
  • Landmark-Based Routing. Provide customers in the U.S. and Canada with turn-by-turn maps that feature such familiar landmarks as gas stations and fast-food restaurants by name.
  • Driving Directions with Traffic-Based Routing. Provide optimized driving directions with step-by-step instructions.
  • Walking Directions. When traveling on foot, users can now find the most direct route to walk to their destination, ignoring one-way streets, medians, and other detours that pertain to motor vehicles.
  • Multipoint Routing. Optimize travel schedules and improve driver efficiency by implementing the Virtual Earth trip planner and multipoint routing.
  • Traffic Reports. Avoid time-consuming traffic jams by using traffic reports that overlay the Virtual Earth map with color-coded traffic flow visuals above the roads that they correspond to. NOTE: These traffic overlays are available to licensed customers that implement the client token authentication infrastructure.
  • GeoRSS Feeds. Import shapes, pushpins, and polylines, with GeoRSS feeds, the de facto standard for geographically encoded objects.
  • Weather Integration. With 3D view, get near real-time weather and cloud formation data.

Get more information:

We have two webcasts coming up next week for you to learn more and get started.

Finally, if you haven’t already get out to http://dev.live.com/virtualearth and check out our updated Interactive SDK and Virtual Earth Web Services SDK. Plus we’re also going to be publishing a bunch more content out on this portal including a whole new round of white papers and other community created content. There’s tons of more options now for building your applications with Virtual Earth so this site should be your one-stop shop for everything Virtual Earth relate


Virtual Earth Based Offline Solution: Toucan Navigate 2007

August 21, 2008 15:45 by gemery

Since I have been traveling I have been looking to use virtual earth offline. I really want to be able to send request locally so I can continue to play around while I am on the road. Yeah Yeah I am in the middle of a beautiful beach in the middle of Colombia and yeah I am thinking of virtual earth. There is obviously something really wrong here, but I digress. So when I was doing my searching I found a really interesting solution by Toucan you can download it here. You can also read a great review of it from the Microsoft Public Dev Team Here.

"The Professional Edition, which is not a free download, includes additional functionality for data sharing. You can collaborate on map files through SQL Server and Groove. The Groove compatibility allows members of a team to access shared map files even when disconnected from the network. Files that are modified while you are offline are automatically uploaded to the common Groove team space once you are reconnected to the network and notification is sent to other team members. "

So you can collaborate and GEO docs and have them sync with a online source even when you off-line. This could make for some cool hand held mapping app's. To tell you the truth of the matter i am still a bit confused between the differences of Microsoft groove and sharepoint and of course live mesh oh and dont forget about astoria I mean sql server in the cloud in mean SSAS. I could use some real guidance of where they intend to take the offline online syncing and where devolopers should spend most of their time for the different types of applications they are using.


SQL Spatial Tutorial 1: Beginning Spatial

May 16, 2008 20:24 by gemery

Spatial it taking root.. Well more like people are starting to realize that spatial rocks and that all data takes on new meaning once you take in its spatial aspect. Representing your data is like seeing your 3D after viewing the world in the 2D for your entire life. Some may say that this is exaggerating but wait until your data tells a 3D story.

So Lets start to dig into spatial.

3D vs 2D

The world is three dimensional object yet most of things we use to view are in 2d. For instance a paper map or a computer screen. Luckily for us we have Virtual Earth and SQL Spatial which takes in both 3D(geography) and 2D(geometry) shapes and types and displays in them in ways that we can visualize them both.

A great visualization from Hanes that shoes the 2D vs 3D visualization

image

Coordinate System

The next thing that never keep in mind is the coordinate system. I never am always amazed at the amounts of different coordinate systems that are out there. I have worked with at least 5 different coordinate systems and there are some that are so complex and so ridiculous that i never seem to start laughing.

For these articles we are going to be using the "WGS84 coordinate system have to consider an ellipsoidal shape of the earth and they can be described as either Cartesian coordinates or through latitude and longitude. Latitudes can have values between +90 and -90 degrees where 0 is at the equator and longitudes can have values between +180 and -180 degrees where 0 has been defined as a place in the Royal Observatory in Greenwich / United Kingdom. As mentioned earlier Virtual Earth in 2D-mode can only work between +85 and -85 degrees because of the Mercator projection."

 

image

So now that we have our basic understanding of 2d vs 3d maps we have or coordinate system lets dig into the SQL spatial


Got Shapes? Check Out shapewiki.com

May 2, 2008 17:04 by gemery

 

Need Shapes? Check out this wiki that enables the user to to add and consume shapes in js/json/geoRss. Its a great way to add layers to your VE maps.

 

image


Virtual Earth Tutorial 2: Adding A Specific Map To A Web Page and Deep Dive into the Load Map Function

April 23, 2008 17:02 by gemery

 

 < Previous Tutorial Adding a basic Map 

LIVE DEMO | SOURCE

We are going to start off with the same code base of the last the Tutorial but this time we want to add a specific map to the page instead of the random map. There are actually several ways to do this but for his situation we are going to do it using a lat and longitude. The first thing we need to do is  get the latitude and longitude for the place that we want to have the map centered on. There are several way to do this but for now i just typed in "lat long for los angeles" and it returned this to me.

34.0° N - 118.2° W

So we are going to be taking this Lat long and use it to modify  the existing LoadMap() function. As you can see below we are going to new up a VELatLong object and pass in the lattitude and longitude to its constructor.

map.LoadMap(new VELatLong(34.0, -118.2)); 

Add in this to the sample from tutorial 1 and you get this map.

image

As you can see the map is centered on Los Angeles.This is really cool but it gets even better. This is where we do the deep dive into what the rest of the variables that  you can pass do. Below you will see a example of the function with all the possible variables that you can pass in.

LoadMap(VELatLong, zoom, style, fixed, mode, showSwitch, tileBuffer, mapOptions)

 

Lets talk about what each one of these variables does

VELatLong - A VeLatLong Class object that represents the center of the map..Like LA
zoom - A zoom level to display. Valid values range from 1 through 19. Optional. Default is 4. 1 being the highest(from Space)
style -

A VEMapStyle Enumeration value specifying the map style. Optional. Default is VEMapStyle.Road. 'h' -hybid, 'r' - road, 'o' - obilique , 'a'  -a ariel

Fixed - A Boolean value that specifies whether the map view is displayed as a fixed map that the user cannot change or move it around. Default is false.
mode - A VEMapMode Enumeration value that specifies whether to load the map in 2D or 3D mode. Optional. Default is VEMapMode.Mode2D or Mode3D. Note 3d requires a plug in
showSwitch - A Boolean value that specifies whether to show the map mode switch on the dashboard control this means change from 2d to 3d. Optional. Default is true (the switch is displayed).
TileBuffer - How much tile buffer to use when loading map. Default is 0 (do not load an extra boundary of tiles). This parameter is ignored in 3D mode. Bigger buffer here gives the user faster reaction when they start to drag the map around
mapOptions - A VEMapOptions Class that specifies other map options to set.

 

Now that we have that out of the way we can go ahead and play with all the values.Check out this demo i have set up for you. Of course the all source included. It works best in firefox right now due to a bug in ie. I  am working on a fix.

LIVE DEMO | SOURCE

image


Virtual Earth JavaScript Intellisense Helper 6.1 Released

April 17, 2008 14:40 by gemery

 

  1. Consolidated all scripts into a single VEJavaScriptIntellisenseHelper.js file for better portability
  2. Updated Default.aspx to point to the 6.1 Map Control
  3. Updated Default.aspx.js to explain how to get intellisense everywhere for a page level map variable
  4. Added a readme.txt with history

 

Webcast Coming Check Back Soon1

Download it here

Technorati Tags: ,