Google Groups Home
Help | Sign in
View kml file on local pc
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  14 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Falk  
View profile
(1 user)  More options Oct 7, 8:37 am
From: Falk <falkhohm...@googlemail.com>
Date: Tue, 7 Oct 2008 06:37:36 -0700 (PDT)
Local: Tues, Oct 7 2008 8:37 am
Subject: View kml file on local pc
hi
i try to view my kml files to view on my local pc without hosting it
on a web server but i wont get it.
at first i tried this method but i have to creat that XML file
seperatly and can't get my own icons

 function load() {

                var map = new GMap2(document.getElementById("map"));
                map.addControl(new GSmallMapControl());
                map.addControl(new GMapTypeControl());

                GDownloadUrl("data.xml", function(data, responseCode) {
                        var xml = GXml.parse(data);
                        var way = xml.documentElement.getElementsByTagName("way");
                        var points = [];
                        for (var i = 0; i < way.length; i++) {
                                var point = new GLatLng(parseFloat(way[i].getAttribute("lat")),
parseFloat(way[i].getAttribute("lng")));
                                points.push(point);
                        }

                        map.addOverlay(new GPolyline(points, "#0000FF", 4));

                        var markers = xml.documentElement.getElementsByTagName("marker");
                        for (var i = 0; i < markers.length; i++) {
                                var point = new
GLatLng(parseFloat(markers[i].getAttribute("lat")),
parseFloat(markers[i].getAttribute("lng")));
                                map.addOverlay(new GMarker(point));
                        }
                });
    }

and because i already have the kml files it woulb be silly to creat a
xml file with the same content so i tried this

function load() {
                 var map;
                 var geoXml;

                GDownloadUrl("data.kml", function(data, responseCode) {
                if (GBrowserIsCompatible()) {
                  geoXml = new GGeoXml("c:\data.kml");
                map = new GMap2(document.getElementById("map"));
                map.addControl(new GSmallMapControl());
                map.addControl(new GMapTypeControl());
                map.addMapType(G_SATELLITE_3D_MAP);
                map.addOverlay(geoXml);
                }
                });
    }

but i can't use local kml files in this method only kml files on web
servers

i have to get this method work to use my kml file
or to write a kml parser for the first method, but this would be too
difficult for me
does anyone have an idea how to solve my problem? uploding the kml
file to a webserver is no option for me, i want to run it local


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
geocodezip@gmail.com  
View profile
 More options Oct 7, 8:51 am
From: "geocode...@gmail.com" <geocode...@gmail.com>
Date: Tue, 7 Oct 2008 06:51:30 -0700 (PDT)
Local: Tues, Oct 7 2008 8:51 am
Subject: Re: View kml file on local pc
On Oct 7, 6:37 am, Falk <falkhohm...@googlemail.com> wrote:

Then you can't use GGeoXml.  You may be able to use one of the third
party parsers,  however, since per the TOU your map _has_ to be public
if you want to use the free Google Maps API, you probably should break
down and get a free web hosting account. Google is nice enough to
allow you to test some things on your local PC.

  -- Larry


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Barry Hunter  
View profile
 More options Oct 7, 8:52 am
From: "Barry Hunter" <barrybhun...@googlemail.com>
Date: Tue, 7 Oct 2008 14:52:20 +0100
Local: Tues, Oct 7 2008 8:52 am
Subject: Re: View kml file on local pc
Seeing as you not allowed to use the API locally it's rather a moot
point. But there are other KML parsers available, eg GeoXML or
EGeoXML. (You may still need to use a proxy)

--
Barry

- www.nearby.org.uk - www.geograph.org.uk -


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike in Stroud  
View profile
 More options Oct 7, 8:52 am
From: Mike in Stroud <mike.be...@stroud.gov.uk>
Date: Tue, 7 Oct 2008 06:52:40 -0700 (PDT)
Local: Tues, Oct 7 2008 8:52 am
Subject: Re: View kml file on local pc

On Oct 7, 2:37 pm, Falk <falkhohm...@googlemail.com> wrote:
uploding the kml

> file to a webserver is no option for me, i want to run it local

Why is it not an option for you?
Any map you create using the API has to be publicly available on the
web to be viewed by anyone so the code for you map will have to be
uploaded to a web server.

But for *testing* you can use your local PC, but you'll need a web
server running on your PC to do this, so c:\data.kml will not work,
will usually be http://localhost/data.kml


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
geocodezip@gmail.com  
View profile
 More options Oct 7, 8:54 am
From: "geocode...@gmail.com" <geocode...@gmail.com>
Date: Tue, 7 Oct 2008 06:54:27 -0700 (PDT)
Local: Tues, Oct 7 2008 8:54 am
Subject: Re: View kml file on local pc
On Oct 7, 6:52 am, Mike in Stroud <mike.be...@stroud.gov.uk> wrote:

> On Oct 7, 2:37 pm, Falk <falkhohm...@googlemail.com> wrote:
> uploding the kml

> > file to a webserver is no option for me, i want to run it local

> Why is it not an option for you?
> Any map you create using the API has to be publicly available on the
> web to be viewed by anyone so the code for you map will have to be
> uploaded to a web server.

> But for *testing* you can use your local PC, but you'll need a web
> server running on your PC to do this, so c:\data.kml will not work,
> will usually behttp://localhost/data.kml

You can test without a webserver on your local PC (using the file:///
protocol).
  -- Larry

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Falk  
View profile
 More options Oct 7, 9:39 am
From: Falk <falkhohm...@googlemail.com>
Date: Tue, 7 Oct 2008 07:39:53 -0700 (PDT)
Local: Tues, Oct 7 2008 9:39 am
Subject: Re: View kml file on local pc
hi i allready tried the file method and it does not work or did i
something wrong? i dont realy know what to put in the GDownloarUrl
and i the fact why i dont want to use a web server is that i generate
a kml file through a program i have written and want to show it in GE
or GM automaticaly. GE is working fine but not GM.

function load() {

                 var map;
                 var geoXml;

                GDownloadUrl("file:///C:/data.kml", function(data, responseCode) {

                if (GBrowserIsCompatible()) {
                  geoXml = new GGeoXml("file:///C:/data.kml");
                map = new GMap2(document.getElementById("map"));
                map.addControl(new GSmallMapControl());
                map.addControl(new GMapTypeControl());
                map.addMapType(G_SATELLITE_3D_MAP);
                map.addOverlay(geoXml);
                }
                });
    }

thrid party parsers would be great if u can tell me how to use them or
where i find excamples or a how to
there is still the option with the simple XML parser if u can tell me
if there is an oportunity to user custom icons because now there is no
icon defined and GM is using a standard icon


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
geocodezip@gmail.com  
View profile
 More options Oct 7, 9:53 am
From: "geocode...@gmail.com" <geocode...@gmail.com>
Date: Tue, 7 Oct 2008 07:53:58 -0700 (PDT)
Local: Tues, Oct 7 2008 9:53 am
Subject: Re: View kml file on local pc
On Oct 7, 7:39 am, Falk <falkhohm...@googlemail.com> wrote:

> hi i allready tried the file method and it does not work or did i
> something wrong?

Probably.  But since it is local and you won't post a legal copy, we
can't tell.

> i dont realy know what to put in the GDownloarUrl
> and i the fact why i dont want to use a web server is that i generate
> a kml file through a program i have written and want to show it in GE
> or GM automaticaly. GE is working fine but not GM.

> thrid party parsers would be great if u can tell me how to use them or
> where i find excamples or a how to

Try searching the group.
http://groups.google.com/group/Google-Maps-API/search?group=Google-Ma...

> there is still the option with the simple XML parser if u can tell me
> if there is an oportunity to user custom icons because now there is no
> icon defined and GM is using a standard icon

This is all irrelevant if you aren't going to put it on the web, you
aren't allowed to use the API.

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Williams  
View profile
 More options Oct 7, 9:56 am
From: Mike Williams <nos...@econym.demon.co.uk>
Date: Tue, 7 Oct 2008 15:56:38 +0100
Local: Tues, Oct 7 2008 9:56 am
Subject: Re: View kml file on local pc
Wasn't it geocode...@gmail.com who wrote:

All the XML parsing is performed by a Google server. The code in the
client sends the URL to the server, the server reads the file and sends
back a list of things for the client to display.

(I sincerely hope that) Google servers can't read XML files that reside
on a local PC unless you run a public webserver.

--
http://econym.org.uk/gmap
The Blackpool Community Church Javascript Team


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
geocodezip@gmail.com  
View profile
 More options Oct 7, 10:07 am
From: "geocode...@gmail.com" <geocode...@gmail.com>
Date: Tue, 7 Oct 2008 08:07:47 -0700 (PDT)
Local: Tues, Oct 7 2008 10:07 am
Subject: Re: View kml file on local pc
On Oct 7, 7:56 am, Mike Williams <nos...@econym.demon.co.uk> wrote:

I was (probably incorrectly) talking about testing general maps and
xml data (not GGeoXml...).


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Falk  
View profile
 More options Oct 7, 10:17 am
From: Falk <falkhohm...@googlemail.com>
Date: Tue, 7 Oct 2008 08:17:09 -0700 (PDT)
Local: Tues, Oct 7 2008 10:17 am
Subject: Re: View kml file on local pc

> Probably.  But since it is local and you won't post a legal copy, we
> can't tell.

 legal copy of what?

ok so how is it possible to use another icon for the markers insted of
the standart icon?
or better can i use different icon in the map and when it is possible
how can i do this?


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.