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

河南浪博网站开发专业培训机构

河南浪博网站开发,专业培训机构,iis网站的建设,中央人民政府网电话需求:根据后端返回的定位坐标数据实现定位渲染 1.效果图 2.准备工作,在main.js和index.js文件中添加以下内容 main.js app.use(BaiduMap, {// ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */ak: sRDDfAKpCSG5iF1rvwph4Q95M…

需求:根据后端返回的定位坐标数据实现定位渲染

1.效果图

2.准备工作,在main.js和index.js文件中添加以下内容

main.js
app.use(BaiduMap, {// ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */ak: 'sRDDfAKpCSG5iF1rvwph4Q95M6tDCApL',// v:'3.0',  // 默认使用3.0// type: 'WebGL' // ||API 默认API  (使用此模式 BMap=BMapGL)
});index.js<script type="text/javascript" src="https://api.map.baidu.com/getscript?v=3.0&ak=sRDDfAKpCSG5iF1rvwph4Q95M6tDCApL"></script>

3.html

<template><div><div id="main6"style="width:650px;height:400px;"></div>  </div>
</template>

4.script

<script setup>
import * as echarts from 'echarts';
import 'echarts/extension/bmap/bmap';
import {onMounted,defineProps} from 'vue';// import chinaMap from 'https://geo.datav.aliyun.com/areas_v3/bound/100000_full.json'const props = defineProps(['data'])var initData = JSON.parse(JSON.stringify(props)).dataconsole.log(initData,'88888888888888888888888888888888266')const initMap = () =>{var chartDom = document.getElementById('main6');var myChart = echarts.init(chartDom);var option;option = {backgroundColor: 'rgba(0,0,0,.1)',title: {text: '当前服务地区',left: 'center',textStyle: {color: '#fff'}},tooltip: {trigger: 'item'},bmap: { //地理坐标系组件用于地图的绘制,支持在地图地理坐标系上绘制散点图,线集center: [120.22221, 30.2084],zoom: 10,roam: true, //是否允许鼠标放大缩小mapStyle: { //地图显示的样式styleJson: [{featureType: 'water',elementType: 'all',stylers: {color: '#044161'}},{featureType: 'land',elementType: 'all',stylers: {color: '#004981'}},{featureType: 'boundary',elementType: 'geometry',stylers: {color: '#064f85'}},{featureType: 'railway',elementType: 'all',stylers: {visibility: 'off'}},{featureType: 'highway',elementType: 'geometry',stylers: {color: '#004981'}},{featureType: 'highway',elementType: 'geometry.fill',stylers: {color: '#005b96',lightness: 1}},{featureType: 'highway',elementType: 'labels',stylers: {visibility: 'off'}},{featureType: 'arterial',elementType: 'geometry',stylers: {color: '#004981'}},{featureType: 'arterial',elementType: 'geometry.fill',stylers: {color: '#00508b'}},{featureType: 'poi',elementType: 'all',stylers: {visibility: 'off'}},{featureType: 'green',elementType: 'all',stylers: {color: '#056197',visibility: 'off'}},{featureType: 'subway',elementType: 'all',stylers: {visibility: 'off'}},{featureType: 'manmade',elementType: 'all',stylers: {visibility: 'off'}},{featureType: 'local',elementType: 'all',stylers: {visibility: 'off'}},{featureType: 'arterial',elementType: 'labels',stylers: {visibility: 'off'}},{featureType: 'boundary',elementType: 'geometry.fill',stylers: {color: '#029fd4'}},{featureType: 'building',elementType: 'all',stylers: {color: '#1a5787'}},{featureType: 'label',elementType: 'all',stylers: {visibility: 'off'}}]}},series: [{name: '', type: 'effectScatter', //样式coordinateSystem: 'bmap', //该系列使用的坐标系data:[],  // data的数据格式为[{name:'海门',value:['121.15','31.89',200]},{name:'海门111',value:['121.15','31.89',200]}...] encode: {value: 2},showEffectOn: 'render',rippleEffect: { //涟漪特效相关配置。brushType: 'stroke' //波纹的绘制方式},symbolSize: 10,  //标记的大小,可以设置数组或函数返回值的形式hoverAnimation: true, // 鼠标移入放大圆label: {formatter: '{b}',position: 'right',show: true},itemStyle: {    //样式color: '#f4e925',shadowBlur: 10,shadowColor: '#333'},emphasis: { //高亮状态下的多边形和标签样式scale: true},zlevel: 1}]};// 处理数据 将数据转换成echart可以识别的数据格式,例如[{name:'海门',value:['121.15','31.89',200]},{name:'海门111',value:['121.15','31.89',200]}...],详情请查echart地图坐标let result = []initData.map((item,index)=> {let child = {name: '', value:['','']}child.name = item.commNamechild.value[0] = Number(item.mapX)child.value[1] = Number(item.mapY)child.value[2] = Number(item.mapY)result.push(child)})console.log(result,'result')option.series[0].data = result// myChart.registerMap('china', { geoJSON: chinaMap })option && myChart.setOption(option);}onMounted(() => {initMap()}) 
</script>
http://www.ds6.com.cn/news/5580.html

相关文章:

  • 做网站用什么团建廊坊seo关键词优化
  • 网站栏目结构设计网站关键词优化推广哪家快
  • 凡科网站可以做淘宝客吗一键建站免费
  • 网页设计作业动漫网页网站seo规划
  • html5网站app开发宁波优化seo是什么
  • 自学网站制作教程阿里巴巴运营
  • 网站建设亿玛酷技术排名sem优化软件
  • 杭州网站建设代理商体验营销理论
  • WordPress导入hexo海外seo推广公司
  • 电子政务平台官网seo建站营销
  • 天津交友网站建设郑州百度网站优化排名
  • 做网约车网站个人博客登录首页
  • 泰安企业网站制作微信小程序开发费用一览表
  • 设计师网站都有哪些永久免费自助建站系统
  • 专门做装修的网站有哪些店铺推广渠道有哪些方式
  • 平凉市住房和城乡建设局网站公司网站营销
  • 口碑好的坪山网站建设惠州seo代理商
  • 用wordpress做的网站今日热点头条
  • java门户网站开发教程东莞seo优化推广
  • 海南网站优化优化二十条
  • 石家庄网站制作公司哪家好北京seo公司有哪些
  • 网站管理助手+建设中怎么建立个人网站
  • 汉口做网站公司关键词如何快速排名
  • 坑人网站怎么做网络服务器价格
  • 美国房产网站西安疫情最新数据消息中高风险地区
  • wordpress 测试高可用seo规则
  • 中国政务网站建设绩效评估国际新闻视频
  • bootstrap网站后台模板最新新闻事件今天疫情
  • 网站参数设定收录好的网站有哪些
  • 网站开发常问的技术性问题辽阳网站seo