上一页 1 2 3 4 5 6 7 8 ··· 35 下一页

openLayer实现放大缩小

摘要: openLayer使用自定义的图标,实现地图的放大缩小 // 放大地图 function zoomIn() { var view = map.getView(); // 让地图的zoom增加1,从而实现地图放大 view.setZoom(view.getZoom() + 1); } // 缩小地图 阅读全文
posted @ 2021-09-13 10:47 一往无前! 阅读(668) 评论(0) 推荐(0) 编辑

openLayer的切换中心点、定位功能

摘要: 设置重新设置定位的功能 1.ol的定位功能 map.getView().setCenter([经度,纬度]) map.getView().setZoom(11); 2.根据经纬度,重新确定中心位置 map.getView().animate({ // 只设置需要的属性即可 center: [经度,纬 阅读全文
posted @ 2021-09-13 10:44 一往无前! 阅读(3768) 评论(0) 推荐(1) 编辑

使用openLayer加载arcgis中的地图

摘要: 由于项目中需要用到openLayer引入arcgis中的服务,所以特此分享以下 var img = new TileLayer({ source: new XYZ({ url: 'https://map.geoq.cn/arcgis/rest/services/ChinaOnlineStreetWa 阅读全文
posted @ 2021-09-13 10:18 一往无前! 阅读(662) 评论(0) 推荐(0) 编辑

openLayer实现两个地图联动

摘要: 其主要思想就是将两个地图放在一个view即可 <template> <div class="main"> <div id="map1"></div> <div id="map2"></div> </div> </template> <script> import {Map,View} from 'o 阅读全文
posted @ 2021-09-10 11:56 一往无前! 阅读(251) 评论(0) 推荐(0) 编辑

使用ol进行底图的切换

摘要: 使用openLayer进行天地图的显示,以及底图的切换 <template> <div> <div id="mapDiv" class="mapDiv"> </div> <button @click="change_img">切换影像底图</button> <button @click="chang 阅读全文
posted @ 2021-09-08 10:57 一往无前! 阅读(184) 评论(0) 推荐(0) 编辑

ol text属性

摘要: options: font 字符串类型.用逗号隔开每个属性 默认:10px sans-serif 其原型就是应用在Canvas上的字体样式. 其取值有可以取 css font 中的样式 maxAngle 数字类型. 前提必须是placement属性设置为line 默认:45°(Math.PI / 4 阅读全文
posted @ 2021-09-08 09:59 一往无前! 阅读(201) 评论(0) 推荐(0) 编辑

vue中引入天地图

摘要: 参考链接:https://blog.csdn.net/Wuyo_7/article/details/107253632 首先在public文件夹的index.html中引入天地图的api文件 <script src="http://api.tianditu.gov.cn/api?v=4.0&tk=您 阅读全文
posted @ 2021-09-07 18:10 一往无前! 阅读(3388) 评论(0) 推荐(0) 编辑

使用openLayer在地图上添加标注

摘要: 因为在实际的项目中要用到这个功能,找了好久才得以实现,代码来自:https://www.jianshu.com/p/4af2a52a0fc6 效果如下; 需要引入的类 //添加标注所用到的类 import Vectors from 'ol/layer/Vector.js' import { WMTS 阅读全文
posted @ 2021-09-07 17:58 一往无前! 阅读(1438) 评论(0) 推荐(0) 编辑

解决vue中图片无法加载问题

摘要: 可以先使用require获取以下,然后将photo赋值给对应的位置 var photo = require("../assets/index/selected.png");img:photo; 或者在使用时直接使用require img: require('./../assets/index/sel 阅读全文
posted @ 2021-09-07 17:45 一往无前! 阅读(476) 评论(0) 推荐(0) 编辑

vue项目实现界面跳转

摘要: 为了使程序更加清晰,在src文件夹中建立router文件夹 ,在其中新建index.js,在此定义每个界面的路由。 import Vue from 'vue' import Router from 'vue-router' import index from '../components/index 阅读全文
posted @ 2021-09-06 10:08 一往无前! 阅读(582) 评论(1) 推荐(1) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 35 下一页