0

I have an array that contains over 1000+ markers for Google Earth.

At the moment I am looping through the array with a for loop which is causing the Earth to freeze until they have all loaded successfully.

Can anyone recommend the best way to handle this so it loads a lot quicker for visitors?

Ideally I was thinking of loading only those markers in view/bounds but haven't seen any documentation to support this idea.

Any help would be greatly appreciated!

Thanks

4

2 に答える 2

1

HTML5 WebWorkersを使用してマーカーを非同期的にインスタンス化し、show()/hide() にあるメソッドを使用して、オブジェクトを反復処理することをお勧めします。

WebWorkers を実装する最新のブラウザーでのみ動作しますが、別の効率的な方法はないと思います

于 2012-05-16T13:56:50.670 に答える
0

1 つの可能性は、代わりに KML 更新を使用してサーバーからこれを行うことです: https://developers.google.com/kml/documentation/updates

各更新は、たとえば 100 個のマーカーをロードして表示し、1 秒後にリロードして次の 100 個のマーカーをプルします。

于 2012-05-24T20:47:21.290 に答える