当前位置: 首页 > wzjs >正文

建设工程合同的内容有哪些seo技术最新黑帽

建设工程合同的内容有哪些,seo技术最新黑帽,网站建设流程行情,惠水县政府网站建设注:当前使用的是 ol 5.3.0 版本,天地图使用的key请到天地图官网申请,并替换为自己的key 地图导航除了单点定位导航,还可以根据动态模拟运动轨迹,并标绘导航路线。本文基于JSON格式模拟运动轨迹数据,实现动态…

注:当前使用的是 ol 5.3.0 版本,天地图使用的key请到天地图官网申请,并替换为自己的key

地图导航除了单点定位导航,还可以根据动态模拟运动轨迹,并标绘导航路线。本文基于JSON格式模拟运动轨迹数据,实现动态定位导航功能。本节主要介绍加载地图运动轨迹

1. 创建轨迹

通过ol.geom.LineString创建线几何对象,然后创建线图层并添加到地图中。

// 用LineString存储轨迹点的地理信息(XYZM,Z维度用来存储角度/M则为时间维度)
const lineGeometry = new ol.geom.LineString([], ('XYZM'));
const lineLayer = new ol.layer.Vector({source: new ol.source.Vector({features: [new ol.Feature({geometry: lineGeometry})]}),style: new ol.style.Style({fill: new ol.style.Fill({color: 'red'}),stroke: new ol.style.Stroke({color: 'blue',width: 2.5})})
})
map.addLayer(lineLayer)
lineLayer.setProperties({ layerName: 'lineLayer' })

2. 创建导航定位标注

通过Overlay创建标注图层。

// 创建导航定位标注
const markerImage = document.getElementById("geolocation_marker")
const markerOverlay = new ol.Overlay({positioning: 'center-center',element: markerImage,stopEvent: false
})
map.addOverlay(markerOverlay)

3. 生成轨迹

设置一个定时器,每隔2s钟改变一个标注点,并更新线几何对象坐标,然后将标注点移至地图中心点,调用render函数重新渲染地图。

function startFoot() {if (!footData.length) {console.warn("轨迹数据未加载!")return}const coordinates = footData // 运动轨迹数组const firstFoot = coordinates.shift()// 生成运动轨迹线,添加下一个点,在定时器中const lineCoords = []let timeInterval = setInterval(() => {if (!coordinates.length) {clearInterval(timeInterval)timeInterval = nullreturn}const firstFoot = coordinates.shift()firstCoords = [firstFoot.coords.longitude, firstFoot.coords.latitude]lineCoords.push(firstCoords)lineGeometry.setCoordinates(lineCoords)map.getView().animate({ center: firstCoords, zoom: 20 })markerOverlay.setPosition(firstCoords)map.render()}, 2000)
}

4. 完整代码

其中libs文件夹下的包需要更换为自己下载的本地包或者引用在线资源。

<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>运动轨迹</title><meta charset="utf-8" /><script src="../libs/js/ol-5.3.3.js"></script><script src="../libs/js/jquery-2.1.1.min.js"></script><link rel="stylesheet" href="../libs/css//ol.css"><style>* {padding: 0;margin: 0;font-size: 14px;font-family: '微软雅黑';}html,body {width: 100%;height: 100%;}#map {position: absolute;top: 50px;bottom: 0;width: 100%;}#foot-location {position: absolute;width: 100%;height: 50px;background: linear-gradient(135deg, #ff00cc, #ffcc00, #00ffcc, #ff0066);color: #fff;}.view-center {position: absolute;line-height: 50px;width: 100%;text-align: center;}.view-center span {border-radius: 5px;border: 1px solid #50505040;padding: 5px 20px;color: #fff;margin: 0 10px;background: #377d466e;}.view-center span:hover {cursor: pointer;filter: brightness(120%);background: linear-gradient(135deg, #c850c0, #4158d0);transition-delay: .25s;}</style>
</head><body><div id="map" title="地图显示"></div><div id="foot-location"><div class="view-center"><span class="start-foot">开启运动轨迹</span></div></div><img id="geolocation_marker" src="./geolocation_marker_heading.png" />
</body></html><script>//地图投影坐标系const projection = ol.proj.get('EPSG:3857');//==============================================================================////============================天地图服务参数简单介绍==============================////================================vec:矢量图层==================================////================================img:影像图层==================================////================================cva:注记图层==================================////======================其中:_c表示经纬度投影,_w表示球面墨卡托投影================////==============================================================================//const TDTImgLayer = new ol.layer.Tile({title: "天地图影像图层",source: new ol.source.XYZ({url: "http://t0.tianditu.com/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=2a890fe711a79cafebca446a5447cfb2",attibutions: "天地图注记描述",crossOrigin: "anoymous",wrapX: false})})const TDTImgCvaLayer = new ol.layer.Tile({title: "天地图影像注记图层",source: new ol.source.XYZ({url: "http://t0.tianditu.com/DataServer?T=cia_w&x={x}&y={y}&l={z}&tk=2a890fe711a79cafebca446a5447cfb2",attibutions: "天地图注记描述",crossOrigin: "anoymous",wrapX: false})})const map = new ol.Map({target: "map",loadTilesWhileInteracting: true,view: new ol.View({// center: [11421771, 4288300],// center: [102.6914059817791, 25.10595662891865],center: [104.0635986160487, 30.660919181071225],zoom: 10,worldsWrap: true,minZoom: 1,maxZoom: 20,projection: "EPSG:4326"}),layers: [TDTImgLayer, TDTImgCvaLayer],// 鼠标控件:鼠标在地图上移动时显示坐标信息。controls: ol.control.defaults().extend([// 加载鼠标控件// new ol.control.MousePosition()])})map.on('click', evt => {console.log(evt.coordinate)})// 用LineString存储轨迹点的地理信息(XYZM,Z维度用来存储角度/M则为时间维度)const lineGeometry = new ol.geom.LineString([], ('XYZM'));const lineLayer = new ol.layer.Vector({source: new ol.source.Vector({features: [new ol.Feature({geometry: lineGeometry})]}),style: new ol.style.Style({fill: new ol.style.Fill({color: 'red'}),stroke: new ol.style.Stroke({color: 'blue',width: 2.5})})})map.addLayer(lineLayer)lineLayer.setProperties({ layerName: 'lineLayer' })// 创建定位导航对象const geolocation = new ol.Geolocation({projection: map.getView().getProjection(),tracking: true,  // 开启定位追踪trackingOptions: {maximumAge: 10000,enableHighAccuracy: true, // 是否开启高精度timeout: 60000 // 最大等待时间,毫秒}})// 创建导航定位标注const markerImage = document.getElementById("geolocation_marker")const markerOverlay = new ol.Overlay({positioning: 'center-center',element: markerImage,stopEvent: false})map.addOverlay(markerOverlay)// 请求模拟运动的轨迹数据let footData = []fetch("./foot-location.json").then(response => {console.log(response)if (response.status == 200) {response.json().then(res => {footData = res.datadocument.querySelector(".start-foot").addEventListener('click', startFoot())})}})function startFoot() {if (!footData.length) {console.warn("轨迹数据未加载!")return}const coordinates = footData // 运动轨迹数组const firstFoot = coordinates.shift()// 生成运动轨迹线,添加下一个点,在定时器中const lineCoords = []let timeInterval = setInterval(() => {if (!coordinates.length) {clearInterval(timeInterval)timeInterval = nullreturn}const firstFoot = coordinates.shift()firstCoords = [firstFoot.coords.longitude, firstFoot.coords.latitude]lineCoords.push(firstCoords)lineGeometry.setCoordinates(lineCoords)map.getView().animate({ center: firstCoords, zoom: 20 })markerOverlay.setPosition(firstCoords)map.render()}, 2000)}
</script>

OpenLayers示例数据下载,请回复关键字:ol数据

全国信息化工程师-GIS 应用水平考试资料,请回复关键字:GIS考试

【GIS之路】 已经接入了智能助手,欢迎关注,欢迎提问。

欢迎访问我的博客网站-长谈GIShttp://shanhaitalk.com

都看到这了,不要忘记点赞、收藏 + 关注

本号不定时更新有关 GIS开发 相关内容,欢迎关注 !

http://www.dtcms.com/wzjs/283973.html

相关文章:

  • 七牛云最新消息武汉网站营销seo方案
  • 建设个人网站的参考网站及文献网站建设费用都选网络
  • 哪个网站做新中式如何做网页设计
  • 做优化网站能以量取胜么西安网站推广助理
  • webmaster网站制作沈阳优化推广哪家好
  • 课程设计代做网站php沈阳seo推广
  • 方微商城网站开发网站访问量排行榜
  • 网站推广文章怎么写中国营销网
  • 成都 广告公司网站建设网络推广软件有哪些
  • tp5做企业网站东莞做网站最好的是哪家
  • bs网站开发网站搜索优化官网
  • 建设网站需要的编程手游推广平台哪个好
  • 做网站竟然不知道cms百度官网电话客服24小时
  • 标准网站建设哪家便宜信息流优化师简历模板
  • 广东网站建设制作价格搜索引擎的工作原理有哪些
  • 电脑当服务器做网站上海今天最新发布会
  • 电影网站如何做seo排名长沙seo全网营销
  • 网页制作 页面链接其他网站 杭州百度开户
  • 做网站那个平台seo没什么作用了
  • 公司内网网站建设外贸推广是做什么的
  • 经营性网站需要什么手续离我最近的广告公司
  • 海南省建设培训与注册中心网站网页设计模板素材图片
  • 策划书word模板范文抖音seo怎么做的
  • 如果建设网站深圳网络营销的公司哪家好
  • excel做网页放进网站电商网站项目
  • 黑马网站建设百度公司排名多少
  • win2003建设网站软文网站大全
  • 专业做包装设计网站给网站做seo的价格
  • 公司做网站是管理费用by网站域名
  • 一个vps可以建多少网站全球十大搜索引擎排名