Home > Uncategorized > Serving Google Earth Links from a website

Serving Google Earth Links from a website

If you want to automatically load a location in Google Earth from a website, here are the steps…
 
Write an ASPX page like this:
<kml xmlns="http://earth.google.com/kml/2.0">
<Placemark>
  <description>Whatever</description>
  <name><%=strName%></name>
  <address><%= strAddress %></address>
</Placemark>
</kml>
 
The code behind is:

public string strName = "";

public string strAddress = "";

private void Page_Load(object sender, System.EventArgs e)

{

   Response.ContentType="application/earthviewer";

   strName="name..";

   strAddress="Address…";

}

 
Then add an application mapping into IIS by pressing website > Properties > Configuration > Add
 
Executable: C:WINDOWSMicrosoft.NETFrameworkv1.1.4322aspnet_isapi.dll
Extension: KML
 
Then Add the following into the web.config
 

<system.web>

<

httpHandlers>

<add verb="GET, HEAD, POST, DEBUG" path="*.kml" type="System.Web.UI.PageHandlerFactory"></add>

</httpHandlers>

</system.web>

 
Now rename the ASPX file to a .KML file, and it can be called from a browser
 
Advertisements
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: