PolymapsJSライブラリを使用してプロジェクトを作成しています。私は約200,000ポイントをプロットする必要があります。ポイントをブラウザにロードするのに時間がかかり、その後、ナビゲーションが非常に遅くなります。
ドキュメントを読みましたが、データをページに追加する前にGeoJsonをフィルタリングするオプションはありません。
誰かがこれよりも良い方法を提案できますか?
var po = org.polymaps;
var map = po.map()
.container(document.body.appendChild(po.svg("svg")))
.center({lat: 45.468318, lon: 9.1709})
.zoom(13)
.add(po.interact());
//Skinning the map
map.add(po.image()
.url(po.url("http://{S}tile.cloudmade.com"
+ "/1a1b06b230af4efdbb989ea99e9841af" // http://cloudmade.com/register
+ "/998/256/{Z}/{X}/{Y}.png")
.hosts(["a.", "b.", "c.", ""])));
//Importing the geoJSON
map.add(po.geoJson()
.url("test_4sq.json")
.id("streets")
.on("load", loadAreas)
.tile(false));
map.add(po.compass()
.pan("none"));
// This function loads all the data and then do the filtering (very sluggish method)
function loadAreas(obj) {
for (var i = 0; i < obj.features.length; i++) {
var f = obj.features[i];
var e = obj.features[i].element;
var p = obj.features[i].data.properties;
e.setAttribute('r', 4);
e.setAttribute('id', f.data.id);
e.setAttribute('title', p.venueName);
//console.log(e);
// Displaying the data in August (month propriety = '8')
if (p.month != "08")
console.log(e);
else
e.setAttribute('display', 'none');
}
}