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:
<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
Categories: Uncategorized
Comments (0)
Trackbacks (0)
Leave a comment
Trackback