My Google Earth Website

80 views
Skip to first unread message

Greg-WBSR

unread,
Jan 28, 2010, 6:20:36 PM1/28/10
to KML Developer Support - Google Earth Plug-in
Hi Everyone,

I have recently released a web page using the Google Earth plugin, and
would like to thank everyone in this discussion group. I have been
searching through it for a while now and have learned basically
everything here.

I have created a 3D trail map for the Whistler Blackcomb ski resort
with toggleable runs/lifts etc.

You can see it here

http://whistlerblackcombsnowreport.com/trailmap/

I would really appreciate it if someone would be kind enough to look
at it and offer suggestions to make it better.

There is probably a few WAY better ways to do what I have done, but it
was the only way I could come up with to make it work.

I have a few specific requests if anyone can help me out:

1. The main one - How do I go about putting a link on my website (eg
in a blog post) which will open the GE page in a new page AND load a
specific kmz file. I would like to be able to tell people ' I skied
THIS line' and have them click on the word THIS and have it go to a
certain 'lookat view' to show them where exactly that run is.

2. Would it be possible to make the image overlay in the top left
corner be a clickable link (and if so, I would like to make it rotate
between a few different images which link to different webpages)

3. Is it possible to 'protect' my individual kmz files from being
downloaded by people who want to copy them or just see what is in
them? I have played with checking referrers, but it seems that it is
not the webpage that is the referrer but the home PC.

Other than that, I would love to hear suggestions about how to
improve / what to add etc.

Lastly, how would I go about applying to have my page added to the
Google site as an 'example' (if they would want it)

Thanks again

Greg

Nymor

unread,
Jan 29, 2010, 2:14:15 PM1/29/10
to KML Developer Support - Google Earth Plug-in
Hi Greg,

1. To link to the page and auto-goto/load a specific kmz you'll
probably want to use url parameters.

Loading the page in a separate window would just be part of the <a>
link tag you use but the url would be structured something like
www.mysite.com?kmz=xyz. Then within the page you would parse the url
to extract the stuff after the ? and whatever you need with that.
Here's an example of url parameter parsing - first one I can too so
just Google to find others and some readaround docs.
http://snipplr.com/view/463/get-url-params-2-methods/
What these functions do is take the url params and put them in an
array which can then access/use.

2. You can make screen overlays clickable by working out where within
the GE pane the user clicks and then if that co-incides with where the
overlay is then you know the user has clicked on that and you can do
what ever you want to do from there. The nearest example I could find
of this is
http://earth-api-samples.googlecode.com/svn/trunk/demos/customcontrols/index.html
Ignore the stuff about the shim - it's just the ScreenOverlay button
code that would be useful here. In this a ScreenOverlay is created
using createScreenOverlayButton and then a click-listener is added
using google.earth.addEventListener - the last part of the javascript.
You'd have to work through to see what's happening but the code is
there to work out whether the user clicked on the overlay and just
does a simple alert to say so. You'd need something similar.

3. Not any way to really protect your kmz files - if they can be
accessed they can be saved and opened.


As for more general stuff....

There comes a time when there are things you'd like to do that require
you to create/edit you kmzs using something other than Google Earth
itself. I can see from you kmzs that they are saved from within GE by
looking at how the Styles are written (GE does them in a certain way)
and there are things you can do to these files that you can't do using
GE. This would require you to edit the kmz using a text editor.

One of the comments on your main site mentions the difficulty in
reading the placemark names etc and this can be solved by using
StyleMaps. GE itself creates very basic StyleMaps when you save a file
but to really get the most out of them you have to edit the kml by
hand. Doing this you can set the StyleMaps such that the text/icon etc
can be much bigger when you hover over a placemark for example. You
could also use them, and a bit of javascript, to switch the Styles
used in such a way that the item(s) being focused on (selected in your
panes) are more prominent than those unselected. At the moment it
difficult to tell what I've selected.

Doing this would be a bit of a learning curve as you'd need some more
javascript functions to change styles used on the fly and also the
extra bit of hand-editing kmls. However this is a step many of us have
gone through and it's well worth the effort involved.

Other comments would be about general look a feel and a few minor, nee
picky, things.

I'd put some margins around the outside of your content so it doesn't
quite butt up to the edge of the page. You can do this with individual
css chnages or, the way I do, as you're using the ui-layout plugin
just wrap your content within another Layout layer.

I'd also make all your input buttons the same size and try a limit
your use of colours a bit as too many can sometimes be a bit hard on
the eyes, and look at making your icons a bit softer around the edges.
What I do with mine is to surround them with a "halo" of blurred
white.

One other thing I think would be quite funky would be to have your
gondolas/lifts etc raised so that when you zoom in they are raised
above, and not clamped to, the ground.

Sounds quite a lot and I hope it doesn't come across as being critical
as it's not meant that way - it's only I know from going through this
process myself that the devil is in the detail and making a useful
site even better will be worth the pain in the long run.

Good luck and if you need any pointers I'm sure as alays there will be
those here willing to help out if they can.

Regards
Nymor

Greg-WBSR

unread,
Jan 30, 2010, 4:59:54 PM1/30/10
to KML Developer Support - Google Earth Plug-in
Thanks Nymor for the help. That looks like what I am after.
I will sit down over the next few days and see if I can piece it all
together.

On Jan 29, 11:14 am, Nymor wrote:
> Hi Greg,
>
> 1. To link to the page and auto-goto/load a specific kmz you'll
> probably want to use url parameters.
>
> Loading the page in a separate window would just be part of the <a>
> link tag you use but the url would be structured something likewww.mysite.com?kmz=xyz. Then within the page you would parse the url
> to extract the stuff after the ? and whatever you need with that.
> Here's an example of url parameter parsing - first one I can too so
> just Google to find others and some readaround docs.http://snipplr.com/view/463/get-url-params-2-methods/
> What these functions do is take the url params and put them in an
> array which can then access/use.
>
> 2. You can make screen overlays clickable by working out where within
> the GE pane the user clicks and then if that co-incides with where the
> overlay is then you know the user has clicked on that and you can do
> what ever you want to do from there. The nearest example I could find
> of this ishttp://earth-api-samples.googlecode.com/svn/trunk/demos/customcontrol...

Greg-WBSR

unread,
Jan 31, 2010, 6:12:55 PM1/31/10
to KML Developer Support - Google Earth Plug-in
Hi Nymor,

Thanks again for the help. I intend to follow up on some of your other
suggestions (especially the 'edit the kml by hand' to change the
styles/fonts, which is something I wanted to do but thought
impossible), but firstly I want to get my point no.1 sorted out.
I have managed to pass a variable and have it load a kmz file,
however, it doesn't change the lookat view.

You can see my example page here
http://whistlervisitorguide.com/vmi/test/

if you load it with a variable such as
http://whistlervisitorguide.com/vmi/test/?x=blue
you will see it loads with all the blue runs active

I know I have 'hardcoded' the lookat view when the page loads - but I
tried deleting that and when the page loads it shows the default view
of the whole globe. I have put my hardcoded version back in so it will
take you to the right part of the globe. and yes the blue.kmz file
does have a snapshot view which is directly above the mountains
looking down (not going to be used that way, but just for testing)

I came across your example page at
http://www.thekmz.co.uk/GEPlugin/examples/pminurl/pminurl.htm
http://www.thekmz.co.uk/GEPlugin/examples/pminurl/pminurl.htm?london

and saw that it is able to load the page with a certain lookat view -
I have tried for a while now to try and incorporate that into my page,
but no luck.

I realize it needs the DOMwalk js and I have included that - but have
removed all my attempts at using it - any chance you could have a look
at the page and put me in the right direction ?

In the end, I will probably need to pass 2 variables (x=blue and
y=run_name) in order to get the blue runs to load and the lookat view
of a certain run but if you can help me sort out the lookat stuff, I
could probably put the two together.

Cheers
Greg

Berwyn

unread,
Feb 16, 2010, 2:17:11 AM2/16/10
to KML Developer Support - Google Earth Plug-in
Greg

Great job on the site, Its good to see other people making use of GE
plugin.

Hopefully streetview will get enabled within the GE plugin in the
future, the recent streetview imagery via snowmobile would be a great
integrated with your app.

Are you surviving the Olympic rush?

Berwyn

Greg-WBSR

unread,
Mar 11, 2010, 10:04:19 PM3/11/10
to KML Developer Support - Google Earth Plug-in
Thanks Berwyn,

I certainly intend to try and include the streetview stuff, but to be
honest I find it hard to use, and not very useful.

The Olympics were fantastic, but now it is time to get back into self-
teach mode and work on this website :)

One last thing, referring to my original question 3.

Would it possible to set a cookie with the page, and then restrict
people from downloading the .kmz files if they don't have the cookie?

I ask because there is already one person out there using my kmz data
for their own application. They have a program which can make 'tours'
out of my ski runs, and they directly target my kmz files for the data
- bandwidth stealing at the very least. I know I can keep changing the
file and directory names, but that would be a big PITA.

Thanks

Nymor

unread,
Mar 12, 2010, 5:35:11 AM3/12/10
to KML Developer Support - Google Earth Plug-in
Hi Greg,

Using your KMZ without acknowledgement is a pretty {insert colourful
adjective here} thing to do. The least I would expect someone to do in
this case is to have a footer that links back to your site with a
Thanks in there.

While you can make it harder for someone to use your data you can't
stop it completely - they could always make a copy and host it
themselves. Depending on your server setup there are ways to restrict
where your KMZ can be loaded from - for example only allowing access
to it from your site. I'm no expert on this, and maybe others could
help with the technicalities, but if you're on an Apache server you
could use .htaccess files to prevent hotlinking. See
http://www.javascriptkit.com/howto/htaccess10.shtml
for an example.

The same principles should be available for IIS servers but I don't
use those so don't know anything about that.

Sorry to hear that someone is taking your data without a nod to your
site and hope the above helps at least on the bandwidth stealing side
of things.

Regards
Nymor

ps Out of interest which site is doing this to you if you don't mind
saying.

Forrest

unread,
Mar 13, 2010, 10:41:09 AM3/13/10
to KML Developer Support - Google Earth Plug-in
Hi to both Greg and Nymor,
on the subject of properly acknowledging "borrowed" JavaScript code,
or KMZ's, or what ever, what is the protocol?
- I'm fairly inexperienced with the world of web development (been
doing big ERP systems for years).

But most everything I've been putting on my G-Maps mashup's is
plagiarized javascript from Google examples, or other folks web sites.

I try to put comments directly in my JavaScript where I got the code,
but is that enough? (and just assume view source will be enough).
...am I suppose to dress up the web page itself with an
acknowledgments and explanations where all the code came from?
...or a link to an explanation-page?

The point: I'm hoping that when I share my creations, that I don't
accidentally offend this community...and would like to at least appear
polite...'

any advice you can provide is appreciated...I'm still learning...

thanks in advance
Forrest
hor...@gmail.com

On Mar 12, 2:35 am, Nymor wrote:
> Hi Greg,
>
> Using your KMZ without acknowledgement is a pretty {insert colourful
> adjective here} thing to do. The least I would expect someone to do in
> this case is to have a footer that links back to your site with a
> Thanks in there.
>
> While you can make it harder for someone to use your data you can't
> stop it completely - they could always make a copy and host it
> themselves. Depending on your server setup there are ways to restrict
> where your KMZ can be loaded from - for example only allowing access
> to it from your site. I'm no expert on this, and maybe others could
> help with the technicalities, but if you're on an Apache server you

> could use .htaccess files to prevent hotlinking. Seehttp://www.javascriptkit.com/howto/htaccess10.shtml

Nymor

unread,
Mar 13, 2010, 11:46:31 AM3/13/10
to KML Developer Support - Google Earth Plug-in
Hi,

The way I do it - which I hope is acceptable - is like this.

If I use a complete module/library of javascript I leave it as is so
it has all the relevent attributions in the header (if the original
author put some there). So for example if I use Roman's
kmldomwalker.js or the gextensions library I just reference them but
don't change them in any way. Alot of open source code is released
under various licences anyway so you should do that to conform to
them.

If I was to modify some js or just take selected functions then I
would put a reference to the original site/author in the header of the
file.

If it's just a small snippet picked from forums etc - like asking "How
do I xyz" and someone provides a bit of code then I will thank them in
the thread but probably wouldn't put anything in my code as with that
sort of thing where do you draw the line - virtually everything I have
is garnered from one source or another (forums, tutorials & books
etc). I try and play the karma game with that in that I will try and
help out others where I can so the balance is restored.

I wouldn't expect any acknowledgement if someone found a bit of my
code useful but would except at least a nod in my direction if a whole
chunk of code was lifted.

As for Gregs situation of someone linking to his KMZ (data) files and
then building on top of that that to me should have some form of
acknowledgement/link on the persons site ... "Base KMZ courtesy of
WhistlerVisitorGuide.com" ... or something like that.


The general rule imo is don't try and pass something off as your own
when it isn't and give credit where it is due. If you do that people,
in general, will forgive a few lapses (as we're not all perfect) when
they can see that you try your best to cover everything.

my 2p

Regards
Nymor

On Mar 13, 3:41 pm, Forrest wrote:
> Hi to both Greg and Nymor,
> on the subject of properly acknowledging "borrowed" JavaScript code,
> or KMZ's, or what ever, what is the protocol?
> - I'm fairly inexperienced with the world of web development (been
> doing big ERP systems for years).
>
> But most everything I've been putting on my G-Maps mashup's is
> plagiarized javascript from Google examples, or other folks web sites.
>
> I try to put comments directly in my JavaScript where I got the code,
> but is that enough? (and just assume view source will be enough).
> ...am I suppose to dress up the web page itself with an
> acknowledgments and explanations where all the code came from?
> ...or a link to an explanation-page?
>
> The point: I'm hoping that when I share my creations, that I don't
> accidentally offend this community...and would like to at least appear
> polite...'
>
> any advice you can provide is appreciated...I'm still learning...
>
> thanks in advance
> Forrest

> [email address]

StarTraX

unread,
Mar 13, 2010, 7:34:21 PM3/13/10
to KML Developer Support - Google Earth Plug-in
First off, I would like to declare my involvement in this issue, it’s
my StarTraX application that is being referred to here, and I did
contact Greg directly at the time to let him know I was doing it. His
response was not at all supportive(!).
The issue of ownership is certainly a troubled one, but not that
complicated really.
On the one hand, if you put material on the internet you are making it
public.
If it contains any inventive or original material then it may be
subject to copyright. The kml files in question, whilst the product of
considerable time and effort, really don’t constitute an original work
in that sense.
If you want to be possessive about the material, then it’s up to you
to protect it.
In my use of the Whistler files, I have not in any way hidden the
source of the data – its address makes its origin quite clear.
On the point about your bandwidth cost of my users downloading your
data – that’s easily resolved with a once-off copy of your files to my
site (which doesn’t charge for bandwidth) and that problem’s solved.
Out of respect for your work, I agree that an appropriate attribution
should be made, and that’s certainly something that I am doing.
Finally, my product is free and commercial-free so there’s no
commercial issue here at all.

Greg-WBSR

unread,
Mar 14, 2010, 3:35:06 PM3/14/10
to KML Developer Support - Google Earth Plug-in
Nymor and Forrest,

Thanks for your help and advice.
1. sorted (can load single kmz on page load and fly to certain view -
I believe I can also make it all toggleable but haven't yet)
2. looks like the link Nymor posted will get me going (haven't had
time to play with it yet)

With regards to js stuff - everything in my page has been copied/
edited from samples given by google and/or people in forums like this
- I only change what i need to make it work.

To see the 'online' version - go to
http://whistlerblackcombsnowreport.com/trailmap/

3.
I have tried to prevent 'hotlinking' but that doesn't do what I want -
I want to stop people from being able to type into the browser address
bar
for eg
http://whistlerblackcombsnowreport.com/trailmap/kmz/black.kmz
and downloading the raw kmz file
ie I want to make the kmz data usable only through interaction on my
webpage

I am looking into using PHP to hide the URL but am not sure if that is
the right way to go about it
maybe use MIME to insist the file gets opened by the plugin and not
downloaded ??

Makes me mad I end up spending so much time trying to protect my work
rather than creating new kmz's

Thanks for your help - and please forgive the next part of this post

Onto Alans (StarTrax) comments
Firstly, funny you respond here, I have tried to email you, but you
never replied.

On Mar 13, 5:34 pm, StarTraX wrote:
> First off, I would like to declare my involvement in this issue, it’s
> my  StarTraX application that is being referred to here, and I did
> contact Greg directly at the time to let him know I was doing it. His
> response was not at all supportive(!).

You are surprised I don't like having someone use my data for their
own gain?

> The issue of  ownership is certainly a troubled one, but not that
> complicated really.
> On the one hand, if you put material on the internet you are making it
> public.

I have not made any links to my raw kmz files public (except for this
post asking others for help on how to hide them) - they are supposed
to be accessed via the google earth plugin page - you have read the
source and bypassed the intended way of accessing this data.
Furthermore, you have told others how to do it - and encourage them to
do so when using your application.

It is possible to save a copy of video you watch on news websites such
as the BBC and NBC by being 'clever' - does that mean I am free to
combine those videos with my own work? How about adding the soundtrack
from the Olympics (I could save a copy of that too) to the video?

> If it contains any inventive or original material then it may be
> subject to copyright. The kml files in question, whilst the product of
> considerable time and effort, really don’t constitute an original work
> in that sense.

Yes, it has taken myself and a friend a lot of time and effort to get
to where we are.
If our kmz files do not represent 'original work' then go and get the
data from where ever else you can get it from - go ahead, help
yourself to this freely available information. Let me know where it is
so I can tell the other people asking me for the data as well.

> If you want to be possessive about the material, then it’s up to you
> to protect it.

It is a shame that I have to, but yes I am now spending my time
working on a way to protect it, rather than creating new data / making
the web page more informative.

> In my use of the Whistler files, I have not in any way hidden the
> source of the data – its address makes its origin quite clear.

I don't see any mention of my website on yours, the only mention is
once (verbally) in the youtube video, in which, at one point you refer
to the 'whistler blackcomb website' which I interpret as the
whistlerblackcomb.com and NOT my website. So thanks for giving them
credit instead of me.

The following is the last stuff I typed:
While responding, I have been exploring your site, and found the 'User
notes' pdf
you do mention my website in that - thanks I guess, but you also show
how you are hosting some of the files (renamed) on your site
you then go to show people how and where to download ALL my raw kmz's

as stated above - my kmz files are only intended to be used through my
GE plugin web page

> On the point about your bandwidth cost of my users downloading your
> data – that’s easily resolved with a once-off copy of your files to my
> site (which doesn’t charge for bandwidth) and that problem’s solved.
> Out of respect for your work, I agree that an appropriate attribution
> should be made, and that’s certainly something that I am doing.
> Finally, my product is free and commercial-free so there’s no
> commercial issue here at all.
>

To quote your website:
'The program you download is a trial, unlicensed version.'

'To license the program, which will allow it to run indefinitely, you
will have to buy a Registration Key'

'This is a new project and we haven't yet set up a facility to sell
this service, and until we do, the first 50 lucky users to submit the
following form with their network adapter number (like 00069B2B9823),
will get a free registration. Can't say fairer than that! '

So your product is not exactly 'free' as you state you intend to
charge for it in the future.


So Alan, while I may not be able to stop you from personally using my
data as you like - there are probably avenues to stop you from telling
other people how to do it.

Sorry to everyone else who reads this post.

Greg-WBSR

unread,
Mar 14, 2010, 3:38:51 PM3/14/10
to KML Developer Support - Google Earth Plug-in
Would it be possible to use 'sessions' in PHP to set a cookie, and if
a person has that cookie, let them access the kmz?
Reply all
Reply to author
Forward
0 new messages