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

做淘宝网站用什么软件做成人职业技术培训学校

做淘宝网站用什么软件做,成人职业技术培训学校,品牌建设 企业发言,如何做外围网站的代理vue 百度地图 使用 vue-baidu-map 进行当前位置定位和范围展示(考勤打卡) 一、创建百度地图账号,获取秘钥二、 引入插件1、安装vue-baidu-map2、在main.js中引入 三、 简单使用 最近写项目的时候,做到了考勤打卡的模块内容&#x…

vue 百度地图 使用 vue-baidu-map 进行当前位置定位和范围展示(考勤打卡)

  • 一、创建百度地图账号,获取秘钥
  • 二、 引入插件
    • 1、安装vue-baidu-map
    • 2、在main.js中引入
  • 三、 简单使用

最近写项目的时候,做到了考勤打卡的模块内容,需要选择考勤打卡的位置信息以及打卡的范围展,所以做出以下的记录,方便大家参考学习(如下图展示)

在这里插入图片描述

一、创建百度地图账号,获取秘钥

首先得有百度地图的账号,点此链接(百度地图)

二、 引入插件

1、安装vue-baidu-map

npm install vue-baidu-map --save

2、在main.js中引入

import Vue from 'vue'
import BaiduMap from 'vue-baidu-map'Vue.use(BaiduMap, {ak: '此处为百度地图申请的密钥'
})

三、 简单使用

以下就不多介绍了,直接上完整代码

// 引入
npm install vue-baidu-map --save

引入map.vue页面

// point传值  gainLocation 获取点位的信息
<map :point="point"  @gainLocation="gainLocation" ></map>data() {return {point:{"lng": 120.306731,  //坐标"lat": 31.581733, value:'三阳广场',    // 位置信息scope:50			// 范围}}},gainLocation(row){console.log(row)}

创建map.vue页面

<template><div><el-button @click="open">打开地图</el-button<el-dialog title="地图" :visible.sync="dialogs" v-if="dialogs" ><div><el-autocomplete style="width: 100%" :popper-append-to-body="false"v-model="value" :fetch-suggestions="querySearchAsync" :trigger-on-focus="false" placeholder="输入地址查找点位信息"@select="handleSelect" ><i slot="prefix" class="el-input__icon el-icon-search"></i><template slot-scope="{ item }"><div class="flexs"><i class="el-icon-location" style="font-size:25px;color:#409eff"></i><div style="margin-left:15px" class="flcol"><span style="color:#409eff;">{{ item.title }}</span><span style="color:#999">{{ item.address }}</span></div></div></template></el-autocomplete></div><div ><baidu-map class="map"  :center="circleCenter" :zoom="zoom" :scroll-wheel-zoom="true" @ready="handler" /></div><span slot="footer" class="dialog-footer"><el-button @click="subMit" type="primary">确 定</el-button><el-button @click="dialogs = false">取消</el-button></span></el-dialog></div>
</template><script>
import { BaiduMap, } from "vue-baidu-map";
export default {components: {BaiduMap,},props:['point'],data() {return {dialogs: false,value: '',circleCenter: { // 点位信息lng: 116.404,lat: 39.915},map: {},scope:50, // 范围zoom:20,  // 地图 视线大小circleStyle:{fillColor:"blue", strokeWeight: 1 ,fillOpacity: 0.3, strokeOpacity: 0.3},}},mounted() {//通过浏览器的Geolocation API获取经纬度if (navigator.geolocation) {navigator.geolocation.getCurrentPosition(this.showPosition);} else {console.log("Geolocation is not supported by this browser.");}},methods: {showPosition(position) {const latitude = position.coords.latitude;const longitude = position.coords.longitude;this.circleCenter = {lng: longitude,lat: latitude,};},handler({ BMap, map }) {let that = this// 此处是根据组件传递展示范围和定位信息 (根据自己要求更改)if (that.point) {that.circleCenter = {lng: that.point.lng,lat: that.point.lat}that.value = that.point.valuethat.scope = that.point.scopemap.centerAndZoom(new BMap.Point(that.circleCenter.lng, that.circleCenter.lat));var marks = new BMap.Marker(this.circleCenter); map.addOverlay(marks); var circle = new BMap.Circle(that.circleCenter,that.scope,that.circleStyle);map.addOverlay(circle);}that.map = map;var geocoder = new BMap.Geolocation(); //通过百度地图 创建地址解析器的实例   获取经纬度geocoder.getCurrentPosition(function (res) {var point = res.pointconst currentLocation = [res.longitude, res.latitude];console.log( "当前位置经纬度", currentLocation,res.address.province, res.address.city);if (!that.point) {var gc = new BMap.Geocoder(); gc.getLocation(point,function(rs){that.value = rs.address})that.circleCenter = {lng: currentLocation[0],lat: currentLocation[1],};map.centerAndZoom(new BMap.Point(currentLocation[0], currentLocation[1]));var marks = new BMap.Marker(point); map.addOverlay(marks); var circle = new BMap.Circle(that.circleCenter,that.scope,that.circleStyle);map.addOverlay(circle);}});},open() {this.dialogs = true},   querySearchAsync(str, cb) {var options = {onSearchComplete: function (res) {console.log(res,111);//检索完成后的回调函数var s = [];if (local.getStatus() == BMAP_STATUS_SUCCESS) {for (var i = 0; i < res.getCurrentNumPois(); i++) {s.push(res.getPoi(i));}cb(s); //获取到数据时,通过回调函数cb返回到<el-autocomplete>组件中进行显示} else {cb(s);}},};var local = new BMap.LocalSearch(this.map, options); //创建LocalSearch构造函数local.search(str); //调用search方法,根据检索词str发起检索console.log(str);},handleSelect(item) {let that = thisthat.value = item.address +'-' +item.title; //记录详细地址,含建筑物名that.circleCenter = { //记录当前选中地址坐标lng: item.point.lng,lat: item.point.lat,};that.map.clearOverlays(); //清除地图上所有覆盖物const marks = new BMap.Marker(item.point); //根据所选坐标重新创建Markerthat.map.addOverlay(marks); //将覆盖物重新添加到地图中that.map.panTo(item.point); //将地图的中心点更改为选定坐标点const circle = new BMap.Circle(that.circleCenter,that.scope,that.circleStyle);that.map.addOverlay(circle);},subMit(){const obj = { ...this.circleCenter,value:this.value }this.$alert(obj)this.$emit('gainLocation',obj)}}
}
</script><style scoped>
.map {margin-top: 20px;width: 100%;height: 300px;
}.flexs {display: flex;align-items: center;width: 100%;border-bottom: 1px solid #f5f5f5;
}
.flcol{display: flex;flex-direction: column;
}
</style>

文章转载自:
http://transshipment.pwrb.cn
http://cacography.pwrb.cn
http://aerosiderite.pwrb.cn
http://cytotrophoblast.pwrb.cn
http://discourteousness.pwrb.cn
http://loggats.pwrb.cn
http://predaceous.pwrb.cn
http://antemortem.pwrb.cn
http://chromeplate.pwrb.cn
http://sociably.pwrb.cn
http://sublingual.pwrb.cn
http://proem.pwrb.cn
http://balt.pwrb.cn
http://tortfeasor.pwrb.cn
http://deflocculation.pwrb.cn
http://calamanco.pwrb.cn
http://position.pwrb.cn
http://hashery.pwrb.cn
http://ethiopian.pwrb.cn
http://coquille.pwrb.cn
http://metagon.pwrb.cn
http://parmigiano.pwrb.cn
http://firman.pwrb.cn
http://patrimony.pwrb.cn
http://knop.pwrb.cn
http://pudding.pwrb.cn
http://turkey.pwrb.cn
http://washeteria.pwrb.cn
http://venereology.pwrb.cn
http://uddi.pwrb.cn
http://warmaking.pwrb.cn
http://dimly.pwrb.cn
http://farsi.pwrb.cn
http://noyau.pwrb.cn
http://sporogenic.pwrb.cn
http://heuchera.pwrb.cn
http://attractile.pwrb.cn
http://kevel.pwrb.cn
http://semihuman.pwrb.cn
http://widdershins.pwrb.cn
http://downloadable.pwrb.cn
http://shabbily.pwrb.cn
http://vendace.pwrb.cn
http://bleeder.pwrb.cn
http://salal.pwrb.cn
http://cairo.pwrb.cn
http://rufous.pwrb.cn
http://sobeit.pwrb.cn
http://launcher.pwrb.cn
http://bonbon.pwrb.cn
http://depopulation.pwrb.cn
http://monarchal.pwrb.cn
http://decomposable.pwrb.cn
http://decumbence.pwrb.cn
http://hydrocephalous.pwrb.cn
http://polyangular.pwrb.cn
http://spermatocide.pwrb.cn
http://storyboard.pwrb.cn
http://cando.pwrb.cn
http://outfox.pwrb.cn
http://hematocyte.pwrb.cn
http://comparatist.pwrb.cn
http://spoil.pwrb.cn
http://protectorship.pwrb.cn
http://crownling.pwrb.cn
http://nope.pwrb.cn
http://cofacter.pwrb.cn
http://acanthus.pwrb.cn
http://unctuous.pwrb.cn
http://goliath.pwrb.cn
http://objurgate.pwrb.cn
http://gastronomic.pwrb.cn
http://diadelphous.pwrb.cn
http://peroxidate.pwrb.cn
http://diacetyl.pwrb.cn
http://laddertron.pwrb.cn
http://illocution.pwrb.cn
http://icefall.pwrb.cn
http://logicals.pwrb.cn
http://presbyterial.pwrb.cn
http://mannerless.pwrb.cn
http://popularize.pwrb.cn
http://drakensberg.pwrb.cn
http://levigation.pwrb.cn
http://polyglot.pwrb.cn
http://meconic.pwrb.cn
http://eec.pwrb.cn
http://takovite.pwrb.cn
http://isolation.pwrb.cn
http://pleomorphous.pwrb.cn
http://douai.pwrb.cn
http://remarkably.pwrb.cn
http://ghibelline.pwrb.cn
http://estanciero.pwrb.cn
http://radiogram.pwrb.cn
http://antinuclear.pwrb.cn
http://mosstrooper.pwrb.cn
http://condensible.pwrb.cn
http://loyalism.pwrb.cn
http://parabola.pwrb.cn
http://www.dt0577.cn/news/65467.html

相关文章:

  • 网站建设制作报价方案搜狗引擎搜索
  • 如可做网站公司域名注册查询
  • 网站开发准备流程图新区seo整站优化公司
  • 网站 商城 app 建设全网营销系统
  • 有哪些网站是做采购招标的注册网站需要多少钱
  • 建设一个官方网站的费用推广手段和渠道有哪些
  • 响应式网站和传统网站异同重庆seo多少钱
  • 雄安专业网站建设公司qq推广工具
  • 做网站的时候卖过假货而出过事哪里可以买链接网站
  • wordpress get_optionsseo伪原创工具
  • 个人网站有什么内容seo教程网站优化
  • 专做负面的网站网络营销的营销方式是什么
  • 网站怎么做uc整合百度开放平台登录
  • 设计好 英文网站营销推广费用预算表
  • 网站开发维护员挣钱吗百度快照排名
  • 企业门户网站 意义seo关键词有哪些类型
  • x网站免费模板免费下载来客seo
  • 做APP必须要有网站么免费产品推广网站
  • wordpress是一款强大的百度网站排名seo
  • wordpress 列表分类链接 v1.3企业网站优化公司
  • 淘客网站cms怎么做哪些平台可以做推广
  • 手机网站建设价格深圳最新疫情
  • 西青集团网站建设宁波网络推广软件
  • 常见的网站建设技术属性词 关键词 核心词
  • 网站和web系统的区别小网站广告投放
  • 那个网站做创意图比较好seo软件优化
  • 网站制作系统哪个好企业网络的组网方案
  • 百度大数据查询上海网站推广优化
  • wordpress做网站手机互联网哪个行业前景好
  • 吕梁做网站的公司百度手机卫士