[英]How to add many points to OpenLayers map
我想在OpenLayers地圖上的圖層上顯示50,000點。 每個點約為100公里* 100公里。 換句話說,我想將100KM * 100KM的盒子塗成綠色,顏色為179.3333,65.5000。 我在OpenLayers網站上在線找到了本教程: http : //openlayers.org/dev/examples/styles-context.html
但這不是我想要的。 有誰知道任何可以幫助我的教程或文章? 或有關如何做到這一點的任何指示?
此外,如果您認為Openlayers不是正確的工具,並且有更好的工具,可以讓我知道嗎?
謝謝
您要顯示單個點還是要顯示一個大盒子?
顯示50,000點將是很多,並且如果您縮小得很遠,則使用一些群集算法可能很聰明,請參閱http://openlayers.org/dev/examples/strategy-cluster-threshold.html
添加框僅是向Vector圖層添加多邊形的問題,請參見http://openlayers.org/dev/examples/boxes-vector.html
在您的情況下,可能是這樣的:
var map = new OpenLayers.Map('map');
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://vmap0.tiles.osgeo.org/wms/vmap0?", {layers: 'basic'} );
var boxes = new OpenLayers.Layer.Vector( "Boxes" );
var center = OpenLayers.Geometry.Point(179.3333,65.5000);
var bounds = OpenLayers.Geometry.Polygon.createRegularPolygon(center, 0.3, 4, 0);
var box = new OpenLayers.Feature.Vector(bounds.toGeometry());
boxes.addFeatures(box);
map.addLayers([ol_wms, boxes]);
map.zoomToMaxExtent();
然后,找出一種方法來定義100x100公里(我的0.3度不會這樣做),然后向矢量圖層添加樣式圖
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.