简体   繁体   中英

Openlayer is very slow when using WKT Multipolygon with a large number of Points

I'm showing the boundaries of cyprus regions using openlayers with vector layer, I get the coords from a shapefile which has a lot of points, for instance some regions can have a multipolygon with in total :30000 Points.

This is really slow on firefox / IE and in firefox it shows unresponsive script error. Only chrome works well. What's the best way to get it working faster and smoothly ?

I read one answer is to create a WMS server with MapServer to generate the images tiles instead to use the OpenLayers directly but I can't implement that solution because I want to change layer style dynamically to the different features in the vector layer ie to show different colors to the region based on the dynamic value.

How can I overcome this issue. Any Insights would be much appreciated.

I think WMS + TileCache will helps to improve the speed. You mentioned you want to change layer style dynamically, I think there are also some solution to do that with WMS, please check:

https://gis.stackexchange.com/questions/64113/how-to-dynamically-change-sld-style-of-wms-layer-being-served-by-geoserver-from

and http://openlayers.org/dev/examples/sld.html

I'd say that GeoJSON may increase your performance in Firefox. WMS is the best in my opinion, and if you work with mapserver you wouldn't have problems to do what you want, geoserver may help you also, but for dynamic changes I'd say you'd need GeoExt.

Hope this helps,

只是为了展示一个逆向视图,将其作为矢量层发送但在远距离缩放级别上稀疏数据点将提供所需的性能,以及所需的交互性。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM