Fork me on GitHub
摘要: 示例链接:https://openlayers.org/en/latest/examples/cluster.html 阅读全文
posted @ 2020-06-16 09:30 weixiaoxiang 阅读(474) 评论(0) 推荐(0) 编辑
摘要: 问题: 在使用overlay的autoPan属性时,autoPan:true 失效不起作用; 解决方案: 问题可能是因为在overlay.setPosition(coordinate)前未将该overlay添加到map中; 代码: var popup = new ol.Overlay({ eleme 阅读全文
posted @ 2020-06-16 09:27 weixiaoxiang 阅读(725) 评论(0) 推荐(0) 编辑
摘要: 问题:因为多种类型要素放入同一个源,在删除某一类要素时需要遍历整个图层源,符合条件后才执行 source.removeFeature(feature); 这样后导致程序执行速度很慢。 解决方案:在将各类要素添加到source的同时,将所有要素都存入一个数组FeatureList[]中,在需要删除一类 阅读全文
posted @ 2020-06-16 09:21 weixiaoxiang 阅读(187) 评论(0) 推荐(0) 编辑
摘要: for (var i = 0; i < arr.length; i++) { if (A == B ) { arr.splice(i, 1); i--;//i需要自减,否则每次删除都会讲原数组索引发生变化 } } 阅读全文
posted @ 2020-06-16 09:10 weixiaoxiang 阅读(6638) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document< 阅读全文
posted @ 2020-06-16 09:07 weixiaoxiang 阅读(3696) 评论(0) 推荐(0) 编辑