Fork me on GitHub
摘要: let randcolor = () => { let r = 100 + ~~(Math.random() * 100); let g = 135 + ~~(Math.random() * 100); let b = 100 + ~~(Math.random() * 100); return 'r 阅读全文
posted @ 2020-07-14 16:41 weixiaoxiang 阅读(499) 评论(0) 推荐(0) 编辑
摘要: 在使用mapshaper在线转geojson时,应将shp和.dbp .prj等后缀名文件一起添加在网站中,这样转成的geojson中将含有shp的属性字段值。 阅读全文
posted @ 2020-06-28 11:10 weixiaoxiang 阅读(593) 评论(0) 推荐(0) 编辑
摘要: 1.ST_MakePolygon —从LineString创建多边形(将封闭的线转成面)。 ST_MakePolygon(st_geomfromtext(geom) 2 st_geomfromtext(wkt) 将wkt字符串转为geom 阅读全文
posted @ 2020-06-18 16:19 weixiaoxiang 阅读(248) 评论(0) 推荐(0) 编辑
摘要: 1.在使用多边形draw时,双击地图结束绘画的同时地图也会被缩放,需要设置stopClick:true; 1 draw = new ol.interaction.Draw({ 2 source: spacesource, 3 type: drawtype, 4 stopClick:true//取消地 阅读全文
posted @ 2020-06-17 12:00 weixiaoxiang 阅读(322) 评论(0) 推荐(0) 编辑
摘要: 示例链接:https://openlayers.org/en/latest/examples/cluster.html 阅读全文
posted @ 2020-06-16 09:30 weixiaoxiang 阅读(473) 评论(0) 推荐(0) 编辑
摘要: 问题: 在使用overlay的autoPan属性时,autoPan:true 失效不起作用; 解决方案: 问题可能是因为在overlay.setPosition(coordinate)前未将该overlay添加到map中; 代码: var popup = new ol.Overlay({ eleme 阅读全文
posted @ 2020-06-16 09:27 weixiaoxiang 阅读(716) 评论(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 阅读(6627) 评论(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 阅读(3682) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2020-05-15 16:51 weixiaoxiang 阅读(0) 评论(0) 推荐(0) 编辑