Why are my KML markers not loading?

1,747 views
Skip to first unread message

Niklas Rosencrantz

unread,
Jan 17, 2012, 6:21:48 AM1/17/12
to google-map...@googlegroups.com
Hello
My KML markers used to load just fine but now all that displays on my map is water zoomed in at highest detail. How should I fix this? The address to my map is http://www.koolbusiness.com/ and the address to my KML file that the JS should be loading is http://www.koolbusiness.com/list.kml

Thanks for any help
Niklas

Rossko

unread,
Jan 17, 2012, 2:17:25 PM1/17/12
to Google Maps JavaScript API v3
> the JS should be loading is http://www.koolbusiness.com/list.kml

You can confidence-test your KML by pasting its URL in the
maps.google.com search box.
Didn't work for me first time, says 'not found'.
Worked some minutes later - many default blue placemarkers throughout
the world.

Google's KML parsers are quite picky about timeouts, they don't allow
long to fetch your KML. Perhaps your server's performance has dropped
off a bit. Is this a dynamically generated KML or a real file?

Fam Kosterman

unread,
Jan 17, 2012, 7:04:54 AM1/17/12
to google-map...@googlegroups.com
Hello

I'm also looking for a way to load this file

2012/1/17 Niklas Rosencrantz <nikl...@gmail.com>:

> --
> You received this message because you are subscribed to the Google Groups
> "Google Maps JavaScript API v3" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-maps-js-api-v3/-/Gn6Q1CvtT6MJ.
> To post to this group, send email to google-map...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-maps-js-a...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-maps-js-api-v3?hl=en.

--
Fam. Kosterman-Susanti
Adelaertstraat 4
5625 HD Eindhoven

Niklas Rosencrantz

unread,
Jan 17, 2012, 11:50:59 PM1/17/12
to google-map...@googlegroups.com
It is dynamically generated and I try to cache it. It just fails intermittently for no appearant reason. I have Python that generates the KML and the code is checke and should be working. I don't see where the program is wrong?

Thanks
Nick

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.

geoco...@gmail.com

unread,
Jan 18, 2012, 12:10:38 AM1/18/12
to Google Maps JavaScript API v3
On Jan 17, 8:50 pm, Niklas Rosencrantz <nikla...@gmail.com> wrote:
> It is dynamically generated and I try to cache it. It just fails
> intermittently for no appearant reason. I have Python that generates the
> KML and the code is checke and should be working. I don't see where the
> program is wrong?

Take the output of your script, save it as a static kml file, if that
works, the kml is valid, you have timing issues in serving it to
google when it is being dynamically generated.

-- Larry

>
> Thanks
> Nick
>
>
>
>
>
>
>
> On Tue, Jan 17, 2012 at 8:17 PM, Rossko <ros...@culzean.clara.co.uk> wrote:
> > > the JS should be loading ishttp://www.koolbusiness.com/list.kml
Message has been deleted

Niklas Rosencrantz

unread,
Jan 18, 2012, 1:43:03 AM1/18/12
to google-map...@googlegroups.com
I posted most of my code for review to stackoverflow:
http://stackoverflow.com/questions/8906165/troubleshooting-dynamically-generated-kml
Some strategies I can think of are
- Change templating to Jinja2 which could be more effective
- Make a cron job that accesses the file every 5 minutes to keep the data fresh in memcache
- Completely rewrite everything and use JSON instead of KML
- Use a custom map instead of google maps since I'm not getting happy troubleshooting code that is correct

Thank you for the help /Niklas

Rossko

unread,
Jan 18, 2012, 4:51:40 AM1/18/12
to Google Maps JavaScript API v3
> I posted most of my code for review to

Good, this isn't the place for non-Maps code dumps.

> - Make a cron job that accesses the file every 5 minutes to keep the data
> fresh in memcache

Why, how often is your data updated? How about changing your code to
create a new KML file only when the data is updated?

Bear in mind that when using KmlLayer to display KML, your KML (when
successfully read) will be cached at Google's servers for some hours.
If your data changes often, you will need to overcome that caching as
well.

Niklas Rosencrantz

unread,
Jan 18, 2012, 7:43:36 AM1/18/12
to google-map...@googlegroups.com
My data doesn't change often and doesn't tequire the very newest data. It is sufficient for my needs to update the file maybe once a day so I could write a job that updates the file only when data is updated.

Thank you for the help /Nick

Message has been deleted

Niklas Rosencrantz

unread,
Jan 31, 2012, 10:41:53 PM1/31/12
to google-map...@googlegroups.com
This was solved trivially by increasing the deadline which deosn't make the user wait since it's a cron job that refreshes the file.
So now my KML is not generated on the fly anymore and is a blob in the appengine blobstore that gets refreshed once a day.
Performance is quite good but not as good as with an own custom map.
The address to my gmap is www.koolbusiness.com and you should see a google map with KML layer if you go to my map.
Thanks for the support!

Rossko

unread,
Feb 1, 2012, 10:56:43 AM2/1/12
to Google Maps JavaScript API v3
Glad it's working.
The whole business is a bit unsatisfactory, though - we're only
guessing there are timing issues behind it; there seems to be no way
to find out, nor what standards need to be met for reliable use. We
don't know what the game is nor when the rules change.


> Performance is quite good but not as good as with an own custom map.

It will also be scalable in a different, better way (up to the KML
complexity limits)


> The address to my gmap is www.koolbusiness.com

Doesn't work in IE7, no map no errors.

You have invalid duplicate tag ids in yout HTML
<li><a id="region_28" href="/punjab/...
<li><a id="region_28" href="/pondicherry/...
which might be relevant

But I think the issue may be that you have commented out code used for
folks without geolocation

Enoch Lau (Google Employee)

unread,
Feb 1, 2012, 9:20:01 PM2/1/12
to google-map...@googlegroups.com

geoco...@gmail.com

unread,
Feb 1, 2012, 9:38:23 PM2/1/12
to Google Maps JavaScript API v3
On Feb 1, 6:20 pm, "Enoch Lau (Google Employee)" <enoch...@google.com>
wrote:
> The API now returns a status on KmlLayers:http://code.google.com/apis/maps/documentation/javascript/reference.h...

Awesome! Thank you.

Larry


>
> Enoch

Niklas Rosencrantz

unread,
Feb 1, 2012, 9:55:44 PM2/1/12
to google-map...@googlegroups.com
Yes, I forgot to test with IE7 and tested only with new browsers. Thanks a lot for the help.
I'm evaluating whether a custom javascript map is a better user experience but then I think I can't load KML marker to a custom map that would be an imagemap of a country.
Both solutions are good and a custom javascript map gets much better performance than KML in my case, perhaps since it's less requests.
I didn't completely understand "up to the KML complexity limits" - did you mean that I don't use clustering and could face a problem if KML markers get too many?

For another site I removed the GMap and now use a custom map instead (montao.com.br) where I'd like to be able to load markers on a custom map but it seems difficult or impossible while thinkable to load an invisible gmap over your own map and that would also work around the limitation of gmaps that you can't limit the display to just one country and in case for Montao.com.br I wanted to fade all areas except Brazil.


Rossko

unread,
Feb 2, 2012, 4:57:34 AM2/2/12
to Google Maps JavaScript API v3
> I didn't completely understand "up to the KML complexity limits" - did you
> mean that I don't use clustering and could face a problem if KML markers
> get too many?

Nothing to do with clustering, it is the source KML data.
KmlLayer is a shared service and limited to prevent hogging.
The limits are generally taken to be these
http://code.google.com/apis/kml/documentation/mapsSupport.html
3Mb filesize, 1000 features etc.

That KmlLayer status return is brilliant, come back all I said!

Joseph Elfelt

unread,
Feb 2, 2012, 7:20:53 AM2/2/12
to Google Maps JavaScript API v3
Yippee! KmlLayer status - at last!

Thank you Google.
Reply all
Reply to author
Forward
0 new messages