Unable to fetch a KML file

1,269 views
Skip to first unread message

Champlain College Emergent Media Center

unread,
Feb 16, 2010, 4:43:05 PM2/16/10
to KML Developer Support - Getting Started with KML
First off I wanted to say that I am relatively new to KML. And I am
also very new to web site development and HTML/Javascript code.
However, over the last two weeks I have searched through many of the
forums and website sources that are on the internet and it has gotten
me to the point where I am able to load the plugin into a page, create
some toggle buttons for layers and different placemarks, control the
camera, and even direct the camera to cities through a search bar.

This is where my problem comes in. While I have been able to get the
plugin to search for the same KML files that have been used in many of
the tutorials (using the same locations that have been posted and set
up by Google), I have not been able to fetch my own self created KML
files. These KML files would be textured models of the buildings in
the city of Burlington, VT that my team and I have created for a
zoning project.

As far as the method behind the KML files, they were all created in
Google Earth by loading in the .kmz files that were exports from
SketchUp, then inside Google Earth I clicked on the building, Save
Place As..., name it and save it as a .kml file and specify the path
(which in this case is just a folder on the C:\). We tried running
the code a couple times to search for the KML file on the C:\, and
that didn't do anything but return the 'Bad or null KML.' error that
is built into the fetch KML code given in the tutorials. So after
that we tried to upload the files through an ftp up onto the website
we are using to host the plugin, however even when it's on the
website, we're still returning the same 'Bad or null KML' error. The
directories are not changed for the contents of the .kmz files, being
that I made sure that the .kml file is in the same folder as the .dae
and all of the textures.

So basically my question is this: is there an error in the way that
we are constructing our KML files, or is it that our website is not
public like we think it is. I know that I read somewhere that the
fetchKML code will only be able to pull KML from a public url. If the
problem is likely that our site is not public and therefore cannot
host the KML files to be pulled by the plugin, does anyone know where
I might be able to download a tutorial packaged KML example, something
with everything in the right location so that I can throw it up on our
website and figure out for certain that the plugin definitely cannot
pull KML from our website.

Thanks in advance,

Champlain EMC

Rossko

unread,
Feb 17, 2010, 5:52:41 AM2/17/10
to KML Developer Support - Getting Started with KML
> So basically my question is this:  is there an error in the way that
> we are constructing our KML files, or is it that our website is not
> public like we think it is.

Can't tell, because you haven't given us any url that you think ought
to be public.

You don't say what 'plugin' you are using, but many do require the
source KML to be visible from Google's servers i.e. public, because
the servers do the parsing.

FireHawk

unread,
Feb 18, 2010, 10:27:55 AM2/18/10
to KML Developer Support - Getting Started with KML
Hello,
I think I know your problem. You first tried to fetch your kml from
you local drive (c:/) as far as I know that can't be done. I have
tried it, and wish Google would allow that for testing. Next, it
sounds like you put it on and ftp site, while this is an internet
site, you can't fetch from an ftp either, only download and use in GE
stand alone. In order to use your kml file, you need to post it on an
http public website. Then to display your map on a specific webpage
you have to get the GE plug in API code. You then have to make sure
you have the visibility of your placemark turned on in the kml code so
that it displays. Let me know if that works....

ShawnsSpace

unread,
Feb 19, 2010, 6:13:49 AM2/19/10
to KML Developer Support - Getting Started with KML
I had a similar issue - i was serving my file on a server running IIS6
and an upgrade to IIS7 seemed to iron it out. If you are using
standard www.Godaddy.com or www.ShawnsSpace.com hosting you can
upgrade your IIS in your hosting control panel, if you are not then i
would look into adding or upgrading your server to use IIS7.

ShawnsSpace

unread,
Feb 19, 2010, 6:22:56 AM2/19/10
to KML Developer Support - Getting Started with KML
The reason for the upgrade to IIS7 is that you need to create a config
file in the server root or folder root for the application you are
running EG a web.config file adding the google extention of KLM and
KMZ or the server will not serve as part of your application.

Here is a sample of a map i threw together, its KMZ file and
web.config.

http://shawnsspace.com/Maps/
http://shawnsspace.com/Maps/All.Zones.kmz

as per your web.config or config file, open notepad paste the
following into txt file. Save as "All Files" web.config and add to
the root of your application or server root, basicly where ever the
kmz or KLM files are.

<code>
<?xml version="1.0" encoding="utf-8" ?>
<configuration>

<system.webServer>

<staticContent>
<mimeMap fileExtension=".kmz" mimeType="application/vnd.google-
earth.kmz" />
<mimeMap fileExtension=".kml" mimeType="application/vnd.google-
earth.kml+xml" />
</staticContent>

</system.webServer>

</configuration>
<code>



On Feb 19, 5:13 am, ShawnsSpace wrote:
> I had a similar issue - i was serving my file on a server running IIS6
> and an upgrade to IIS7 seemed to iron it out.  If you are using
> standardwww.Godaddy.comorwww.ShawnsSpace.comhosting you can
> > Champlain EMC- Hide quoted text -
>
> - Show quoted text -

ShawnsSpace

unread,
Feb 19, 2010, 6:23:42 AM2/19/10
to KML Developer Support - Getting Started with KML
ooops omit the <code></code> tags didnt know we could not use html
lol.

On Feb 19, 5:22 am, ShawnsSpace wrote:
> The reason for the upgrade to IIS7 is that you need to create a config
> file in the server root or folder root for the application you are
> running EG  a web.config file adding the google extention of KLM and
> KMZ or the server will not serve as part of your application.
>
> Here is a sample of a map i threw together, its KMZ file and
> web.config.
>
> http://shawnsspace.com/Maps/http://shawnsspace.com/Maps/All.Zones.kmz
>
> as per your web.config or config file, open notepad paste the
> following into txt file.  Save as "All Files"  web.config and add to
> the root of your application or server root, basicly where ever the
> kmz or KLM files are.
>
> <code>
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
>
>   <system.webServer>
>
>     <staticContent>
>       <mimeMap fileExtension=".kmz" mimeType="application/vnd.google-
> earth.kmz" />
>       <mimeMap fileExtension=".kml" mimeType="application/vnd.google-
> earth.kml+xml" />
>     </staticContent>
>
>   </system.webServer>
>
> </configuration>
> <code>
>
> On Feb 19, 5:13 am, ShawnsSpace wrote:
>
>
>
> > I had a similar issue - i was serving my file on a server running IIS6
> > and an upgrade to IIS7 seemed to iron it out.  If you are using
> > standardwww.Godaddy.comorwww.ShawnsSpace.comhostingyou can
> > - Show quoted text -- Hide quoted text -

ShawnsSpace

unread,
Feb 19, 2010, 6:40:24 PM2/19/10
to KML Developer Support - Getting Started with KML
You can run your kmz localy, you just need to yhave the right apps
installed EG. Visual Web Developer Express "free" and IIS7 "per
windows machine" minimum from what i can tell. Is how dev my maps.


<code>l to the o to the l testing html probally still disabled</code>

Reply all
Reply to author
Forward
0 new messages