I'm really new to all this KML stuff. I am using the google KML
Reference page to try to create folders, and I am not sure if I am
getting all of the syntax right.
This is what I am trying to accomplish....
I have a google map with 144 locations across the United Sates. I
want to create state by state folders, so that users can click on
their states folder, and only the locations from that state will
appear.
+ Alabama
-location1
-location2
-location3
+ California
-location1
-location2
-location3
The closest thing I have seen to this is at...
http://www.gpsvisualizer.com/examples/google_folders.html
but I don't know how to extract the KML from that map....so I can't
really see what that syntax looks like.
This link has been helpful, but, I'm not sure I'm getting it right....
http://code.google.com/apis/kml/documentation/kmlreference.html#folder
This is the syntax I am using right now...but my folders are not
showing up.
<Folder>
<name>Oregon</name>
<Placemark>
<name>Placemark 3</name>
<description><![CDATA[<div dir="ltr">275 Grimes St, Eugene, OR </
div>]]></description>
<styleUrl>#style201</styleUrl>
<Point>
<coordinates>-123.156395,44.055023,0.000000</coordinates>
</Point>
</Placemark>
<Placemark>
<name>275 Grimes St</name>
<description><![CDATA[Eugene, OR 97402<br>]]></description>
<styleUrl>#style205</styleUrl>
<Point>
<coordinates>-123.156525,44.058147,0.000000</coordinates>
</Point>
</Placemark>
<Placemark>
<name>5751 NE Columbia Blvd</name>
<description><![CDATA[Portland, OR 97218<br><a href="/maps?
f=q&hl=en&geocode=&q=5751+ne+columbia+rd+portland
+or&jsv=137c&sll=35.336221,-97.504392&sspn=0.009155,0.019312&ie=UTF8&latlng=&ei=uockSev1K4K2M-
Cz0NsE&sig2=jFLbWZNoPtBUXMj5pXjElg&dtab=5"><img src="http://
cbk0.google.com/cbk?
output=thumbnail&w=90&h=68&ll=45.569364,-122.604474"></
a>]]></description>
<styleUrl>#style45</styleUrl>
<Point>
<coordinates>-122.604477,45.569363,0.000000</coordinates>
</Point>
</Placemark>
</Folder>
Have I incorrectly defined/labeled my Folder? Do I need to use
<Folder id="ID"> ? Do I need to add <open>1</open> ? or <open>0</
open> ? Did I leave out some other important syntax?
Any hints would be much appreciated. Right now I'm just trying to
stick with Google Maps and editing the KML code...since once I learn
how to create the folder, all I need to do is create the state folders
and organize the data thats already there. Would it be easier for me
to do this editing in Google Earth?
Thanks so much!!
That map doesn't use KML, it use custom embedded data.
> This is the syntax I am using right now...but my folders are not
> showing up.
Your principles seem sound enough to me.
The snippet is missing an <xml..> header and <kml ..> wrapper.
Perhaps if we could see the real thing i.e. share the url to it.
In Google Maps, I'm pretty sure folders will always be expanded by
default. Clicking on a folder name will zoom you in to the part of
the map containing all of the placemarks in that folder. All
placemarks will still be visible unless the user unchecks them, so I'm
not sure that you can make it so that "only the locations from that
state will appear"... they will all appear, but you can zoom in to
each state.
That doesn't explain why you're not seeing folders though, can you
post the full KML file?
As noted by a couple other responders, it's most useful if you can
provide a link to your entire KML rather than just a snippet. In this
case, my best guess is you may want to try to enclose all your folders
in single a <Document> ...
Cheers,
-Josh
On Mar 10, 8:16 am, nellieeve wrote:
> Hi friends,
>
> I'm really new to all this KML stuff. I am using the google KML
> Reference page to try to create folders, and I am not sure if I am
> getting all of the syntax right.
>
> This is what I am trying to accomplish....
> I have a google map with 144 locations across the United Sates. I
> want to create state by state folders, so that users can click on
> their states folder, and only the locations from that state will
> appear.
>
> + Alabama
> -location1
> -location2
> -location3
>
> + California
> -location1
> -location2
> -location3
>
> The closest thing I have seen to this is at...http://www.gpsvisualizer.com/examples/google_folders.html
>
> but I don't know how to extract the KML from that map....so I can't
> really see what that syntax looks like.
>
> This link has been helpful, but, I'm not sure I'm getting it right....http://code.google.com/apis/kml/documentation/kmlreference.html#folder
> +or&jsv=137c&sll=35.336221,-97.504392&sspn=0.009155,0.019312&am p;ie=UTF8&latlng=&ei=uockSev1K4K2M-