I do not load the same combination of KML layers. In fact, it's
dependent on the user's input in a way.

I am able to create a single KML file which contains Polygon
definitions and coordinates from merging all 15+ of the single KML
files. However, my issue with this is that I also have Markers placed
in the center of each Polygon after it renders.

Specifically, I'll have a listener on the "metadata_changed" event for
each of the 15+ single KmlLayers. Then once that fires, I'll create a
Marker setting its position to "this.getDefaultViewport().getCenter()"
which refers to the layer. I pretty much only need the center point
from that layer now that I can generate a KML file on the fly of all
the merged KMLs that the user selects. I've tried not calling the
layer.setMap(myMap) function, but this means that the
"metadata_changed" event never fires. So then I decided to remove the
layer after its "metadata_changed" event fires. This results in a LOT
of requests to google since it has to request to create, then remove.
This method seems to work, but it's very slow due to the large amount
of requests.

Cliffs: Can merge all KMLs into a single KML file, but now can't get
center using layer.getDefaultViewport().getCenter() to set Marker's
position for that "single" KML area.

Thanks for your help so far Barry.

On Mar 30, 2:16 pm, Barry Hunter <barrybhun...@gmail.com> wrote:
> There probably isnt a direct way to overcome it. GMaps is going to try
> displaying them all at once.
>
> But possible ways to work around it:
>
> Do you always load the same combination of KML layers? Can you create a
> single (or fewer) KML file, that are simply network links to the original
> files?
>
> You could also maybe make a handler that accepted parameters on what KML
> files to load, and outputted the relevent files as a network links.
>
> On 30 March 2011 19:42, Tony <ton.anh...@gmail.com> wrote:
>
> > Hi there, I'm experiencing a problem where if create more than 15
> > KmlLayers using the constructor and passing in different KML files for
> > each, there seems to be a bunch of failed requests shown in FireBug
> > with the 414 Error Request-URI Too Large.
>
> > At exactly 15 KmlLayers, the map works as expected. But once I go over
> > this magical number, the polygon regions as defined in each KML file
> > fail to show. However, the markers I have created inside the
> > "metadata_changed" event listener for each individual layer still
> > shows properly. It is only the polygon that has trouble displaying
> > which I assume is the tile returned from Google's servers after the
> > request. The failed requests seem to be ones that are directed at the
> > googleapis.com domain. I've tried copying the request location and
> > counting the characters, and they all seem to be above 2048 which I
> > think is the cut off.
>
> > I've looked to see if anyone has encountered the same issue and there
> > seems to be an unresolved post on Stack Overflow as seen here:
>
> >http://stackoverflow.com/questions/5120823/multiple-kmls-and-414-erro...
> > This post is pretty much exactly what I'm experiencing too.
>
> > Does anyone know of a proper workaround to this?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Maps JavaScript API v3" group.
> > To post to this group, send email to
> > google-maps-js-api-v3@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-maps-js-api-v3+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/google-maps-js-api-v3?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to google-maps-js-api-v3@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to