微信地图map的的小程序
这个小程序页面,把选点,导航,展示门店等功能一体化整合了,而且整合效果比微信的导航+选点插件更加的好。
此版本是第一版,已经基本满足上述要求,如有特殊需求,请自行开发即可。
2.0版本,对地图进行了美化和功能增强,需要测试请到下面测试地址进行测试。
如果需要,你可以将其改造成租车等应用。
测试地址
地址:app.zjhn.top/test/
创建社区团购应用,进行测试
使用帮助
1,请先注册腾讯地图的map key,更改js中的mapkey
2,部分页面和模板未包含,请删除或者创建
3,get_pos()函数为获取gps地址,请自行创建或者编写即可
4,此函数基本上没有太多的后台数据读取
上代码
<import src="../temp.wxml"/><template is="nav" data="{
{nav}}"></template>
<map id="map" longitude="{
{longitude}}" latitude="{
{latitude}}" scale="{
{scale}}" markers="{
{marker}}" enable-3D="true" enable-overlooking="true" enable-rotate="true" enable-building="true" setting="{
{setting}}" bindmarkertap="select_this_point" polyline="{
{polyline}}" bindregionchange="regionchange">
</map>
<view class="shop_list_box">
<view class="ponit" bindtap="moveToLocation" wx:if="{
{show_shop!='show'}}"></view>
<view class="icon icon-roundclosefill" wx:if="{
{show_shop=='show'}}" bindtap="win_close" data-c="show_shop"></view>
<view class="box">
<view class="shop_info" >
<view class="shop_name" bindtap="select_shop_location">{
{shop.shot_name}}</view>
<view class="shop_addr" wx:if="{
{shop.dis && !shop.time}}">距离您<text>{
{shop.dis}}</text></view>
<view class="shop_addr" wx:if="{
{shop.time}}">驾车距离<text>{
{shop.distance}}</text>,预估需要<text>{
{shop.time}}</text></view>
<view class="shop_addr" wx:if="{
{!shop.dis && !shop.time}}">{
{shop.city}}{
{shop.dist}}{
{shop.addr}}</view>
<view class="icon icon-daohang1" wx:if="{
{shop.dis}}" bindtap="daohang"></view>
<view class="icon icon-map-marker-radius" wx:if="{
{ac=='position'}}" bindtap="select_this_position"></view>
</view>
<view class="search_box" wx:if="{
{show_shop!='show' && ac!='daohang'}}" bindtap="win_open" data-c="show_shop">
<text class="icon icon-search" ></text>{
{ac=='daohang'?'查找更多的门店':'查找我的位置'}}</view>
<view class="hide_bt icon icon-chevron-down" wx:if="{
{show_shop=='show'}}" bindtap="win_close" data-c="show_shop"></view>
<view class="addr_list" wx:if="{
{show_shop=='show' && ac=='position'}}">
<view class="search_x"><text class="icon icon-search" ></text><input placeholder="请输入我的位置关键词" value="{
{key}}" bindinput="key_input" bindblur="search_this"></input></view>
<view class="item {
{shop.id==item.id?'select':''}}" wx:for="{
{marker}}" wx:key="id"