1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

asp and google earth kml

Discussion in 'C#' started by motheherder, Dec 6, 2006.

  1. #1
    the following code (below) saved as .asp launches google earth and zooms to the specified coordinates BUT only seems to work if pasted directly into the URL address bar.

    The idea is to be able to link to the file using <a href="kml.asp">klm link</a> however this does not seem to work

    any ideas?

    thank you

    mo


    <%@ Language="VBScript" %>
    <% Option Explicit %>
    <%
    
    Response.Clear
    Response.ContentType="application/vnd.google-earth.kml+xml kml"
    Response.AddHeader "Content-Disposition", "inline; filename=log_test.kml"
    
    Response.Write "<?xml version=""1.0"" encoding=""UTF-8""?>"
    Response.Write "<kml xmlns=""http://earth.google.com/kml/2.0"">"
    Response.Write "<Placemark>"
    Response.Write "<name>" & Now & "</name>"
    Response.Write "<Point>"
    Response.Write "<coordinates>-0.221521253413915,59.5982541259184,0</coordinates>"
    Response.Write "</Point>"
    Response.Write "</Placemark>"
    Response.Write "</kml>"
    
    %>
    Code (markup):
     
    motheherder, Dec 6, 2006 IP
  2. motheherder

    motheherder Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Apologies, this code does work as a link. For all interested, this mime type line 6 works for opening kml files

    thanks

    mo
     
    motheherder, Dec 6, 2006 IP
  3. redruff

    redruff Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    hello,
    The above code worked great, but what I'm trying to do is list several places at once. I keep getting a GE error that says only one allowed under root.
    I just repeated the code between the placemark tags.
    I'm pretty new to KML so sorry if this is basic.
    But any ideas?
     
    redruff, Dec 18, 2006 IP