小程序map组件实现定位
map.wxml
<map class="map" longitude="{
{longitude}}" latitude="{
{latitude}}"
show-location name="" markers="{
{markers}}"></map>
<!-- 获取路线 -->
<view wx:for="{
{arr}}">
<view bindtap="getpath" data-latitude="{
{item.latitude}}" data-longitude="{
{item.longitude}}" data-name="{
{item.name}}">
{
{item.name}}
</view>
</view>
longitude 经度定位
latitude 纬度定位
show-location 显示当前所在位置
markers 显示地点
具体的参数到微信小程序官网查看
https://developers.weixin.qq.com/miniprogram/dev/component/map.html
地图样式自行设置,默认地图很小
map.js
const h