location.html
4.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="author" content="fansabc@gmail.com">
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
<!-- <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" /> -->
<meta content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" name="viewport"/>
<title>选择市场</title>
<link rel="stylesheet" href="../css/style/common.css">
<link rel="stylesheet" href="../css/style/location.css">
</head>
<body>
<div class="m-page">
<header class="m-header">
<div class="head">
<a href="#" class="lt-bar m-icon icon-back white">返回</a>
<h1>批发市场</h1>
<a href="#" class="rt-bar m-icon icon-more white">更多</a>
</div>
</header>
<section class="m-content">
<h2>定位市场</h2>
<ul class="m-table-view">
<li class="cell">
<a href="#">
<span class="title"><i class="m-icon icon-location"></i>哈尔滨哈达批发市场</span>
</a>
</li>
</ul>
<!-- <ul class="list-view">
<li>
<a href="javascript:" class="as-block">
<i class="icon-location"></i>
<span id="now-location">哈尔滨哈达批发市场</span>
</a>
</li>
</ul> -->
<h2>市场选择</h2>
<!-- <ul class="list-view">
<li>
<a href="javascript:" class="as-block">
哈尔滨哈达批发市场
</a>
</li>
<li>
<a href="javascript:" class="as-block">
牡丹江牡达批发市场
</a>
</li>
<li>
<a href="javascript:" class="as-block">
齐齐哈尔哈达批发市场
</a>
</li>
<li>
<a href="javascript:" class="as-block">
贵阳地利批发市场
</a>
</li>
<li>
<a href="javascript:" class="as-block">
沈阳地利批发市场
</a>
</li>
<li>
<a href="javascript:" class="as-block">
山东寿光农产品批发市场
</a>
</li>
</ul> -->
<ul class="m-table-view">
<li class="cell">
<a href="#">
<span class="title">哈尔滨哈达批发市场</span>
</a>
</li>
<li class="cell">
<a href="#">
<span class="title">牡丹江牡达批发市场</span>
</a>
</li>
<li class="cell">
<a href="#">
<span class="title">齐齐哈尔哈达批发市场</span>
</a>
</li>
<li class="cell">
<a href="#">
<span class="title">贵阳地利批发市场</span>
</a>
</li>
<li class="cell">
<a href="#">
<span class="title">沈阳地利批发市场</span>
</a>
</li>
<li class="cell">
<a href="#">
<span class="title">山东寿光农产品批发市场</span>
</a>
</li>
</ul>
</section>
</div>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=bnPuEaT9YSqKBgB0rOd3nHWE"></script>
<div id="allmap" style="display:none;"></div>
<script type="text/javascript">
getLocation();
function getLocation(){
// 百度地图API功能
var map = new BMap.Map("allmap");
//var point = new BMap.Point(116.331398,39.897445);
// map.centerAndZoom(point,12);
var geolocation = new BMap.Geolocation();
geolocation.getCurrentPosition(function(r){
if(this.getStatus() == BMAP_STATUS_SUCCESS){
var mk = new BMap.Marker(r.point);
map.addOverlay(mk);
map.panTo(r.point);
var gc = new BMap.Geocoder();
var pt = new BMap.Point(r.point.lng,r.point.lat);
gc.getLocation(pt, function(rs){
var addComp = rs.addressComponents;
alert( addComp.province + ", " + addComp.city + ", " + addComp.district );
console.log( addComp.street + ", " + addComp.streetNumber );
});
}
else {
alert('failed'+this.getStatus());
}
},{enableHighAccuracy: true})
}
</script>
</body>
</html>