Announcement

Collapse
No announcement yet.

Adding a Google Earth Link to your web page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Adding a Google Earth Link to your web page

    We have just added a link to our exact location on Google Earth – have a look at http://www.yandles.co.uk home page to see how it works… (The link is at the bottom of the page)

    It works by calling a link that is stored as a ‘*.kml’ file on the server. In our case, the link is www.yandles.co.uk/kml/yandles1.kml

    If you are interested in adding a similar feature to your website, the following is a simple tutorial on ‘How To’

    The process consists of:
    A) Capturing the location as a file;
    B) Converting the resulting *.KMZ file into a *.KML file
    C) Minor edit of the *.kml file
    D) Creating a link on the web page.
    E) Uploading the kml file to your server


    A) Capturing the KMZ file for your location:
    a1) Open Google Earth and find your location. Zoom in, rotate and set the angle of view to your needs.
    a2) Click the Mail ICON in the tool bar above the map.
    a3) Select ‘Snapshot of 3D View’ (the middle option), then click on the ‘Mail’ button. This will open up your email software. (You don’t need to actually send the email – see next step)
    a4) In the email software, locate the ‘attachment’ that will be labelled ‘GoogleEarth_Placemark.kmz’. Right click on it and copy it to memory.
    a5) With Windows Explorer, create a directory such as ‘GE KMZ’ and Paste the copied kmz file therein. (Do not close the email client until you have pasted the attachment.)
    a6) For convenience sake, rename the file to something meaningful (as in our case yandles1.kmz)

    B) Converting the KMZ to a KML file:
    The KMZ file is an ordinary zip file and needs to be unzipped. Easily done…
    b1) Simply rename the extension from *.kmz to *.zip (Ignore the warning that you will get!)
    b2) Unzip the file and locate the resulting ‘doc.kml’ (Do not double click on this yet…)
    b3) Rename doc.kml to something meaningful (yandles1.kml)

    C) Minor edit of KML file:
    c1) open the kml file in a text editor such as notepad
    c2) on the 4th line you will see <name>~GE5A.kmz</name> …
    c3) … Change this to something meaningful – our case: <name>Yandles Home</name>
    c4) then on about line 34, find <name>GoogleEarth_Placemark</name> …
    c5) … Change this also - in our case: <name>Yandles of Martock</name>
    c6) Save the file with these 2 minor edits.
    c7) Upload this file on to your server. (In our case, into a directory named ‘kml’)

    D) Creating a link on the web page
    The link is exactly the same as any other standard html link two samples:
    Sample 1) <a href="kml/yandle1.kml">Yandles on Google Earth</a>
    Sample 2) <a href="kml/yandle1.kml"><img src="kml/yandles-on-ge-130pxw.gif" alt="Yandles on Goole Earth" width="130" height="67" border="0" /></a>
    (Sample 2 is a clickable image link)

    Upload the page and away you go…

    - - - - - - - -
    Trouble shooting:
    Test the link in separate browsers especially in IE and Firefox… - Not all host servers are configured to parse a kml or kmz file and act as an ‘Earth Browser Server’. Note: The Actinic Server IS so configured and does act as an Earth Server. (We hare hosted by Actinic )

    If, when you click on the link, you get a page open up and see the code/script, your host browser is not configured to do so…

    Solution 1 – a work around for Internet Explorer. Open the kml file and delete the first line:
    <?xml version="1.0" encoding="UTF-8"?> Make absolutly sure that there are spaces left on the deleted line 1 and that line 2 is now in the line 1 position - this is critical.
    Save and upload to server - This should now work in Internet Explorer. It will not work with Firefox which will still display the code/script.

    Solution 2 – the preferred solution:
    Contact the Systems Administrator at your hosting company. Explain what you are trying to achieve and point him to the Official Google Earth statement:
    QUOTE:
    KML MIME Types
    When responding to a request from Google Earth (or any Earth browser), a KML server must follow a certain set of rules so that Google Earth can correctly interpret its responses.

    Upon success, the server must return a response code of HTTP 200 and set the response's content-type to a suitable MIME type, as described here.
    Google Earth reads KML and KMZ files.

    The MIME type for KML files is
    • application/vnd.google-earth.kml+xml
    The MIME type for KMZ files is
    • application/vnd.google-earth.kmz

    For Apache, add these lines to the httpd.conf file:
    • AddType application/vnd.google-earth.kml+xml .kml
    • AddType application/vnd.google-earth.kmz .kmz

    See the Microsoft documentation for details on setting up MIME types on Microsoft's IIS.

    The body of the response must contain valid KML data, including the XML declaration (<?xml version="1.0" encoding="UTF-8"?>). If the server returns invalid KML, the Network Link will stop, deactivate, and output an error message.
    UNQUOTE

    I am grateful to Chris Dicken and the Actinic Systems Administrator for their help.
    www.yandles.co.uk
    www.websilk.co.uk
    Today is the tomorrow that I worried about yesterday.
    So far, all is well. Am I still worried? YES! Watch some b.....d mess it up!

    #2
    bloody hell!

    Very clever.....like the idea

    Comment


      #3
      though i hate to advocate such things: microsoft.

      their api for maps.live.com also includes access to the 3d portion of their service, and also is client side only, sans the mime type jiggery pokery.

      Comment


        #4
        Nice one, not sure it would suit me yet but worth keeping in mind

        Good Job

        Comment


          #5
          Gotta be worth a mention in the AUG?
          Affordable solutions for busy professionals.
          Website Maintenance | UK Web Hosting

          Comment


            #6
            Nice idea and very good of you to share it, as a 'techy' I find it very interesting - but I'm not sure just how useful it might really be on your site.

            I can't imagine many people downloading a 10Mb app in order to take an aerial flight to your shop. I think that a link to Google Maps as well could be of interest as it doesn't require any application to use it.

            Comment


              #7
              Originally posted by drounding
              Nice idea and very good of you to share it, as a 'techy' I find it very interesting - but I'm not sure just how useful it might really be on your site.

              I can't imagine many people downloading a 10Mb app in order to take an aerial flight to your shop. I think that a link to Google Maps as well could be of interest as it doesn't require any application to use it.
              The dawn of Web 2.0 is upon us.

              Who knows what next years customer will want?

              I agree though, not suited to every site but will sit very nicely in certain niche markets.
              Affordable solutions for busy professionals.
              Website Maintenance | UK Web Hosting

              Comment


                #8
                Originally posted by drounding
                I can't imagine many people downloading a 10Mb app in order to take an aerial flight to your shop. I think that a link to Google Maps as well could be of interest as it doesn't require any application to use it.
                Nor can I , if it were JUST to visit the shop.

                However, Many people already have G E on their machines ... If it helps to get return visits to the website, it has done the job!

                EDIT addition:

                We are an active woodworking mill with large demonstration facilities, woodstore of exotic timbers and large shop selling machines, tools. With an Art Gallery, Hobby & Craft centre and a coffee shop, we have a large number of personal callers - ANYTHING that helps them to find us easily.....
                www.yandles.co.uk
                www.websilk.co.uk
                Today is the tomorrow that I worried about yesterday.
                So far, all is well. Am I still worried? YES! Watch some b.....d mess it up!

                Comment

                Working...
                X