前言:最近在做微信小程序,查阅了网上的一些资料自己做了改动。任务模块中用到了小程序的map组件,实现了定位显示及查询poi显示周边特定设置的功能,点击其中的定位位置,可以显示这个设施的名字和地址。
1.wxml页面
<
view
class=
"menu-item-api-list docList"
>
<
map
class=
"map"
longitude=
"{
{longitude}}"
latitude=
"{
{latitude}}"
include-points=
"{
{points}}"
markers=
'{
{markers}}'
bindmarkertap=
"makertap">
<
cover-view
class=
"map-tab-bar">
<
cover-view
class=
"map-tab-li {
{item.id == status ? 'active' : ''}}"
bindtap=
"getType"
data-type=
"{
{item.id}}"
wx:key=
"aroundListId"
wx:for=
"{
{aroundList}}">{
{item.name}}
</
cover-view
>
</
cover-view
>
<
cover-view
class=
"map-foot"
wx:if=
"{
{showmark}}">
<
cover-view
class=
"mapName">{
{textData.name}}
</
cover-view
>
<
cover-view
class=
"mapDesc">{
{textData.desc}}