~2000 Placemark Placement Effeciency

17 views
Skip to first unread message

gane

unread,
Jun 26, 2009, 3:57:41 PM6/26/09
to KML Developer Support - Google Earth Plug-in
Currently my project calls for reading longitude/latitude coords from
an xml file and simply plotting them on the map. It seems to take 5
seconds to plot around 40 points.... Whats the best way to go about
this for max performance (note: Reading 2000 points and plotting 2000
placemarks all at once. All will be shown.)

Roman N

unread,
Jul 6, 2009, 1:47:04 PM7/6/09
to KML Developer Support - Google Earth Plug-in
Hi gane,

The absolute fastest way is to create a web service that generates KML
and then use fetchKml or KmlNetworkLink to plot it in Google Earth.

The slowdown you've been seeing is probably due to a known bug where
API calls perform poorly on Windows. The current, hacky, workaround is
to wrap those API calls (such as createPlacemark) in a dummy call to
fetchKml:

google.earth.fetchKml(ge, '', function() {
// do batch calls here
for (var i = 0; i < 2000; i++)
...createPlacemark here...
});

This effectively tells the plugin to stop what it's doing until the
inner function completes. A true fix for the slowdown is in the works.
Also note that on Mac, this problem shouldn't exist.

Regardless, I'd recommend the first (web service generating KML)
approach.

Thanks,
Roman

gane

unread,
Jul 17, 2009, 1:17:59 PM7/17/09
to KML Developer Support - Google Earth Plug-in
Hmmm, well thanks for your reply although I'm a little confused. Is
there an example page you can link to see I can see the performance
difference and implementation? Thanks for your time Roman!
> > placemarks all at once. All will be shown.)- Hide quoted text -
>
> - Show quoted text -

gane

unread,
Jul 17, 2009, 1:19:18 PM7/17/09
to KML Developer Support - Google Earth Plug-in
Oh, I forgot to mention. These markers must be viewable in google maps
too... It's a hybrid page with all map types available. I'm not sure
if using the fetchkml will show up in map view?

On Jul 6, 1:47 pm, Roman N wrote:
Reply all
Reply to author
Forward
0 new messages