openlayers
pengbostudio
这个作者很懒,什么都没留下…
展开
-
请求WFS时的小技巧
请求WFS主要是为了实现查询功能,为了实现查询功能我做了多次尝试官网的https://openlayers.org/en/latest/examples/vector-wfs-getfeature.html但是最后返回的json有问题,导致查询功能不能实现,分析为请求wfs的路径有问题即featureNS: 'http://host:8081/geoserver/DCampus/wfs',...原创 2019-01-19 22:12:51 · 1467 阅读 · 0 评论 -
Geoserver的WFS服务
转载自http://www.gisvip.com/bbs/forum.php?mod=viewthread&tid=2723 基于Geoserver发布的wfs服务,与Openlayers结合实现空间和属性信息的查询。wfs包含getFeature操作,用来检索要素信息,支持返回gml格式的地理要素表达。WFS的getFeature操作需要提供的参数: 参数名称 ...转载 2019-01-19 22:21:59 · 8442 阅读 · 0 评论 -
错误提示Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.
导出功能直接写在了index.html中,对应https://openlayers.org/en/latest/examples/export-pdf.html问题:错误提示Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.canvas绘制图片,由于浏览器的安全考...原创 2019-01-19 22:25:30 · 5734 阅读 · 0 评论 -
屏幕画图功能
屏幕画图功能直接写在了index.html中,对应官网https://openlayers.org/en/latest/examples/draw-freehand.html一开始的问题是:绘图后图形不能保存在最上面的图层上。解决:修改了map部分代码,即将后面的addLayer去掉,按照官网doc中的格式添加图层。var map = new ol.Map({ la...原创 2019-01-19 22:27:14 · 901 阅读 · 0 评论 -
openlayers v5.3.0官网例子中的import
目前openlayers的最新版本为v5.3.0,在openlayers官网新例子里使用了ES6的语法,类似这种import,如果不太会这种方式,可以改为加上前缀包名的方式如:ol.Map,ol.View,ol.layer.Tile等等...原创 2019-01-15 23:05:31 · 1039 阅读 · 0 评论 -
有关json的问题
提示Unexpected token < in JSON at position 0错误在请求geoserver的wfs服务时fetch('https://ahocevar.com/geoserver/wfs', { method: 'POST', headers : { 'Content-Type': 'application/j...原创 2019-01-15 23:23:36 · 229 阅读 · 0 评论