地图
文章平均质量分 54
openlayers、百度地图等
卑微猿同学
这个作者很懒,什么都没留下…
展开
-
VUE + 百度地图 ------- 坐标转为百度坐标
Vue中加入百度地图,并转换坐标原创 2023-01-17 17:50:54 · 610 阅读 · 0 评论 -
Uncaught DOMException: Failed to execute ‘toDataURL‘ on ‘HTMLCanvasElement‘
【背景】Vue中使用openlayers,将地图导出为图片,原本使用openlayers官方提供的方法加载地图,但是地图加载太慢了,换成天地图后无法导出图片并报错【问题原因】使用天地图后,没有解决跨域问题,所以图片导出失败【解决方式】添加 crossOrigin:'anonymous',处理跨域问题let tiandiditu = new Tile({ source: new XYZ({ crossOrigin:'anonymous', url: '', }),});.原创 2021-01-25 15:46:00 · 2091 阅读 · 0 评论 -
openlayers以WKT或GeoJSON格式获取图形
【获取特定的】前提:明确矢量图形的feature//WKTvar wktshape = new ol.format.WKT().writeFeature(editorSource.getFeatures()[0]);//GeoJSONvar jsonshape = new ol.format.GeoJSON().writeFeature(editorSource.getFeatures()[0]);【获取刚刚画完的】//新建draw对象var draw = new ol.interact原创 2020-10-23 08:58:09 · 1684 阅读 · 0 评论 -
openlayers处理后台发送的GeoJSON或WKT字符串
【处理WKT格式字符串】var splitfeature = new ol.format.WKT().readFeature(('WKT字符串'), { dataProjection: 'EPSG:4326', //目标坐标系 featureProjection: 'EPSG:4326' //当前坐标系});source.addFeatures(splitfeature);var vectorLayer = new ol.layer.Vector({source: sourc原创 2020-10-23 08:37:46 · 1205 阅读 · 2 评论