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

是在百度中建设网站?做网站有什么用

是在百度中建设网站?,做网站有什么用,如何提高网站索引量,外贸移动商城网站建设引入-初始化地图#xff08;关键代码#xff09; // 初始化页面引入高德 webapi -- index.html 文件 script src https://webapi.amap.com/maps?v2.0key您申请的key值/script// 添加地图容器 div idcontainer /div// 地图初始化应该…引入-初始化地图关键代码 // 初始化页面引入高德 webapi -- index.html 文件 script src https://webapi.amap.com/maps?v2.0key您申请的key值/script// 添加地图容器 div idcontainer /div// 地图初始化应该在地图容器 div 已经添加到 DOM 树之后let map {}; // 初始化背景地图--封装方法 export const mapInit (id index-overView,opts {},styleId amap://styles/XXXXXXXXXXXXXXXXXXXXXXXXX ) {// fc35552908a5c4f34b7330621230b0bd// if(Object.keys(map).length 0){// }map new AMap.Map(id,Object.assign({mapStyle: styleId,zoom: 8,center: [110.412427, 29.303573]// pitch: 50,// viewMode: 3D,// features: [bg, road],},opts));return map; };// 初始化 this.map mapInit(mapContainer2, {mask: mask,viewMode: 3D,pitch: this.pitchList[this.currentAreaList.length - 1],zoom: 9.3,center: [120.66888, 29.686606],features: [bg, road],dragEnable: true,zoomEnable: true,layers: [imageLayer] });设置3d-这时候只需要给版块添加个wall ,把版块抬起来就可以了关键代码 // 添加高度面(只有添加了这个才会有立体的感觉这里用2.0版本Object3DLayer会报错所以改用1.0版本) var object3Dlayer new AMap.Object3DLayer({ zIndex: 1 }); var height -50000; var color #00C2FF; //rgba 384C4B — 242D2D 56,76,75 36,45,45 0.2,0.3,0.3 0.15,0.18,0.18var wall new AMap.Object3D.Wall({path: bounds,height: height,color: color }); wall.transparent true; object3Dlayer.add(wall);this.map.add(object3Dlayer);//修改当前光照-----重点 这里通过修改光照 能到达更好的立体效果 this.map.AmbientLight new AMap.Lights.AmbientLight([1, 1, 1], 0.5); this.map.DirectionLight new AMap.Lights.DirectionLight([0, 2, -14],[1, 1, 1],0.5 );添加纹理图-将图片放在地图上 注意图片一定要按实际比例图片背景必须透明图片边界和地图四个点相交如下图 // 添加纹理地图 var imageLayer new AMap.ImageLayer({url: require(/src/assets/images/entService-platform/texture.png),// 3d模式下不要轻易改动 bounds 的经纬度值哈不然你会后悔的很难调。2d 下通过获取西南方向和东北方向的经纬度即可bounds: new AMap.Bounds([119.194408, 29.128922],[122.143352, 30.943633]),zIndex: 2 });这里面的 bounds 是图片中的左下角坐标,和右上角坐标 ,需要自己计算,调试步骤: 1、通过https://lbs.amap.com/demo/javascript-api-v2/example/district-search/draw-district-boundaries 使用DistrictSearch 绘制城市版块,画出该省市的边界线 2、找到边界线,东西南北的四个顶点坐标, 如上图 标的数字 3、图片左下角坐标 , 是 点1 的经度 和 点2 的纬度 4、图片右上角坐标 , 是 点4 的经度 和 点3 的纬度 这样就得到了bounds 的值 这里四个点通过找到4个点 在拾取器上搜索关键字直接获取到经纬度 点位拾取器 注意这四个点的坐标,要么计算出来,要么就给地图添加点击事件.通过点击事件获取这四个点的坐标 完整代码 initMap() {let district new AMap.DistrictSearch({extensions: all,subdistrict: 1,level: this.currentLevel});district.search(this.activeName, async (status, result) {var districtList result.districtList[0].districtList;var bounds result.districtList[0][boundaries];var mask [];this.polygons [];for (var i 0; i bounds.length; i) {mask.push([bounds[i]]);}// 添加纹理地图var imageLayer new AMap.ImageLayer({url: require(/src/assets/images/entService-platform/texture.png),// 3d模式下不要轻易改动 bounds 的经纬度值哈不然你会后悔的很难调。2d 下通过获取西南方向和东北方向的经纬度即可bounds: new AMap.Bounds([119.194408, 29.128922],[122.143352, 30.943633]mapInit),zIndex: 2});this.map mapInit(mapContainer2, {mask: mask,viewMode: 3D,pitch: this.pitchList[this.currentAreaList.length - 1],zoom: 9.3,center: [120.66888, 29.686606],features: [bg, road],dragEnable: true,zoomEnable: true,layers: [imageLayer]});// 添加高度面(只有添加了这个才会有立体的感觉这里用2.0版本Object3DLayer会报错所以改用1.0版本)var object3Dlayer new AMap.Object3DLayer({ zIndex: 1 });var height -50000;var color #00C2FF; //rgba 384C4B — 242D2D 56,76,75 36,45,45 0.2,0.3,0.3 0.15,0.18,0.18var wall new AMap.Object3D.Wall({path: bounds,height: height,color: color});wall.transparent true;object3Dlayer.add(wall);this.map.add(object3Dlayer);//修改当前光照this.map.AmbientLight new AMap.Lights.AmbientLight([1, 1, 1], 0.5);this.map.DirectionLight new AMap.Lights.DirectionLight([0, 2, -14],[1, 1, 1],0.5);this.map.clearMap();let that this;this.map.on(click, e {that.$emit(closeDatePicker);// window.infoWindow.close();});this.getPolyline(bounds);getBounds({ searchName: 绍兴市 }).then(res {this.countiesCenter res.districtList.map(v {return {name: v.name,center: [v.center.lng, v.center.lat]};});this.changeMapLevel();});});},//添加外围描边--- 外围需要更明显的边界的话 需要单独给外围 描边getPolyline(bounds) {for (var i 0; i bounds.length; i) {new AMap.Polyline({path: bounds[i],isOutline: true,outlineColor: #CAECF9,borderWeight: 3,strokeColor: #69FFFD,strokeWeight: 2,strokeOpacity: 1,map: this.map});}},补充高德地图掩模背景设置透明的前提下 mask 方式设置卫星图层 new AMap.TileLayer.Satellite({ opacity: 0 })
http://www.pierceye.com/news/329991/

相关文章:

  • 深圳app网站建设哪家好广西桂林
  • 网站开发及上线过程网站建设备案策划书
  • 杭州九鸿科技网站开发网站模板 素材
  • 网站建设网站软件有哪些wordpress如何输入拼音
  • 昆山网站建设哪家便宜简单的模板网站
  • 做图标得英文网站wordpress写代码插件
  • 网站网页设计案例wordprees可以做棋类网站吗
  • 天河区门户网站官网小学生一分钟新闻播报
  • 漯河网站建设lhwzzz网络服务器机柜
  • 有口碑的武进网站建设国内做房车游网站
  • 山东省城乡住房和城乡建设厅网站济南网站建设wuliankj
  • 网站首页跳出弹窗wordpress远程后台设置
  • 免费信息网站建设平台影响网站排名的因素 权重
  • 做房产网站接不到电话湖北网站建设平台
  • 厦门国外网站建设公司排名上海自贸区注册公司优惠政策
  • 网站建设的公司实习做什么成都住建局官网住建智慧建管
  • 建一个免费看电影的网站犯法不国家企业信用信息没有网站怎么做
  • 长春网站vantage wordpress
  • 帝国cms如何做网站地图自己做的网站还要买域名么
  • 网站建设与维护税率网络营销案例及视频
  • 网站建设 繁体精品课网站制作
  • 常州 招网站开发seo的名词解释
  • 二级域名网站seo竞价网站建设
  • 麻栗坡网站建设正规网站建设
  • 邯郸网站建设哪家好重庆app开发
  • 自学网站开发多久大型网站建站
  • 网站设计定制多少钱新增备案网站负责人
  • 匿名聊天网站开发网站关键字挖掘
  • 外国域名注册很多网站做网站的人找不到了
  • 好的学习网站打广告免费浏览器网站