Problem loading multiple KML files in a page

548 views
Skip to first unread message

Juan Francisco Vega Damke

unread,
Mar 25, 2013, 9:54:32 AM3/25/13
to google-map...@googlegroups.com
Hey, I have this problem: I have in a single page references to 100 KML files aprox., this is for a GIS. The problem is that some KML files doesn't load at all, this is a "random" problem. It would be great if someone could help me.

Thanks guys!

--
Be the change you want to see in the world

Barry Hunter

unread,
Mar 25, 2013, 10:07:49 AM3/25/13
to google-maps-js-api-v3
Generally can only include 5-7 KmlLayer's on a single map. 

This limit is because the URL of the active KMLs has to be put into a URL to load the map tiles. There is a limit to the number of charactors in a URL. If your URLs are particully long, the limit of layers will be less. 


--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-maps-js-a...@googlegroups.com.
To post to this group, send email to google-map...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Juan Francisco Vega Damke

unread,
Mar 25, 2013, 10:57:26 AM3/25/13
to google-map...@googlegroups.com
Okey, is there any way to include 100+ KML's?


2013/3/25 Barry Hunter <barryb...@gmail.com>

Barry Hunter

unread,
Mar 25, 2013, 11:07:47 AM3/25/13
to google-maps-js-api-v3
Not reliably. 

You could try having one KML file, that just has network links to the others. But should only allows you to include 10  further files. 



You might have some luck with a script that joins the KML files directly. Takes the content of each file and makes one uber file. Will have to be careful munging the files - to only have one <Document> and one <kml> tag, too. Will have to make sure preserve the namespaces. 


(if you can turn on/off individual files, that combining script could take a compact representation of what files to show, so it can create the right combinations) 

geoco...@gmail.com

unread,
Mar 25, 2013, 2:29:38 PM3/25/13
to Google Maps JavaScript API v3
On Mar 25, 7:57 am, Juan Francisco Vega Damke <crusi...@gmail.com>
wrote:
> Okey, is there any way to include 100+ KML's?

How big/complex are the files? Is this for general use (general
internet users who won't wait), or for people that would be willing to
wait for them to load?

The geoxml3 third party KML parser should be able to load an arbitrary
number of KML files, but they will be rendered as native Google Maps
API v3 objects, so the more objects and more complex the KML worse the
map will perform.

geoxml3:
https://code.google.com/p/geoxml3/

-- Larry

>
> 2013/3/25 Barry Hunter <barrybhun...@gmail.com>
>
>
>
>
>
>
>
>
>
> > Generally can only include 5-7 KmlLayer's on a single map.
>
> > This limit is because the URL of the active KMLs has to be put into a URL
> > to load the map tiles. There is a limit to the number of charactors in a
> > URL. If your URLs are particully long, the limit of layers will be less.
>
> > On Mon, Mar 25, 2013 at 1:54 PM, Juan Francisco Vega Damke <
> > crusi...@gmail.com> wrote:
>
> >> Hey, I have this problem: I have in a single page references to 100 KML
> >> files aprox., this is for a GIS. The problem is that some KML files doesn't
> >> load at all, this is a "random" problem. It would be great if someone could
> >> help me.
>
> >> Thanks guys!
>
> >> --
> >> *Be the change you want to see in the world *
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "Google Maps JavaScript API v3" group.
> >> To unsubscribe from this group and stop receiving emails from it, send an
> >> email to google-maps-js-a...@googlegroups.com.
> >> To post to this group, send email to
> >> google-map...@googlegroups.com.
> >> Visit this group at
> >>http://groups.google.com/group/google-maps-js-api-v3?hl=en.
> >> For more options, visithttps://groups.google.com/groups/opt_out.
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "Google Maps JavaScript API v3" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to google-maps-js-a...@googlegroups.com.
> > To post to this group, send email to
> > google-map...@googlegroups.com.
> > Visit this group at
> >http://groups.google.com/group/google-maps-js-api-v3?hl=en.
> > For more options, visithttps://groups.google.com/groups/opt_out.
>
> --
> *Be the change you want to see in the world *

Enoch Lau (Google Employee)

unread,
Mar 26, 2013, 8:19:58 AM3/26/13
to google-map...@googlegroups.com
Are all 100 KML files covering the same area? If not, then if you know the content's bounds for each KML file, you could turn on/off KML layers depending on what the current map bounds is.
> >> email to google-maps-js-api-v3+unsub...@googlegroups.com.
> >> To post to this group, send email to
> >> google-map...@googlegroups.com.
> >> Visit this group at
> >>http://groups.google.com/group/google-maps-js-api-v3?hl=en.
> >> For more options, visithttps://groups.google.com/groups/opt_out.
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "Google Maps JavaScript API v3" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to google-maps-js-api-v3+unsub...@googlegroups.com.

Juan Francisco Vega Damke

unread,
Apr 25, 2013, 9:18:49 PM4/25/13
to google-map...@googlegroups.com
Thanks for the answers guys, but i cant fix it :/. Anyone knows something about Arcgis javascript api?


2013/3/26 Enoch Lau (Google Employee) <enoc...@google.com>
To unsubscribe from this group and stop receiving emails from it, send an email to google-maps-js-a...@googlegroups.com.

To post to this group, send email to google-map...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Juan Francisco Vega Damke

unread,
Apr 25, 2013, 9:20:44 PM4/25/13
to google-map...@googlegroups.com
I need a way to load 100 KML files approx (and maybe more in future), with a decent performance. Any ideas?


2013/4/25 Juan Francisco Vega Damke <crus...@gmail.com>

Barry Hunter

unread,
Apr 26, 2013, 12:11:10 PM4/26/13
to google-maps-js-api-v3
Probably the only realistic way is to process the files on the server. 

Then return either rendered image tiles, or maybe vector tiles that the browser renders. 

Splitting the data into a fixed tile structure, allows for easy caching of the data. As well as meaning the user only downloads the data needed for the current map. 



(basically do what Google is doing via kmllayer, jsut that rather than having to pass full kml urls, you just pass special tokens (that your server knows how to expand to the original source))
Reply all
Reply to author
Forward
0 new messages