map.uvue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763
  1. <template>
  2. <view class="content">
  3. <map class="map" id="map1" ref="map1" :longitude="location.longitude" :latitude="location.latitude" :scale="scale"
  4. :markers="markers" :include-points="includePoints" :polyline="polyline" :polygons="polygons" :circles="circles"
  5. :controls="controls" :show-location="showLocation" :enable-3D="enable3D" :rotate="rotate" :skew="skew"
  6. :show-compass="showCompass" :enable-overlooking="enableOverlooking" :enable-zoom="enableZoom"
  7. :enable-scroll="enableScroll" :enable-rotate="enableRotate" :enable-satellite="enableSatellite"
  8. :enable-traffic="enableTraffic" @markertap="onmarkertap" @callouttap="oncallouttap" @controltap="oncontroltap"
  9. @regionchange="onregionchange" @tap="maptap" @updated="onupdated" @poitap="onpoitap"></map>
  10. <scroll-view class="scrollview" scroll-y="true">
  11. <view class="tips">注意:App和Web需要正确配置地图服务商的Key才能显示地图组件</view>
  12. <view class="uni-title">
  13. <text class="uni-title-text">属性示例</text>
  14. </View>
  15. <input-data defaultValue="13" title="scale: 缩放级别,取值范围为5-18" type="number"
  16. @confirm="confirm_scale_input"></input-data>
  17. <boolean-data :defaultValue="showLocation" title="开启显示带有方向的当前定位点" @change="change_show_location"></boolean-data>
  18. <boolean-data :default-value="enable3D" :disabled="enableSatellite" title="3D效果(放大缩放级别才能看到建筑物3D效果)" @change="change_enable_3d"></boolean-data>
  19. <boolean-data :default-value="showCompass" title="显示指南针" @change="change_show_campass"></boolean-data>
  20. <boolean-data :default-value="enableOverlooking" title="俯视支持" @change="change_enable_overlooking"></boolean-data>
  21. <boolean-data :default-value="enableRotate" title="旋转支持" @change="change_enable_rotate"></boolean-data>
  22. <boolean-data :default-value="enableZoom" title="缩放支持" @change="change_enable_zoom"></boolean-data>
  23. <boolean-data :default-value="enableScroll" title="拖动支持" @change="change_enable_scroll"></boolean-data>
  24. <boolean-data :default-value="enableSatellite" title="卫星图" @change="change_enable_satellite"></boolean-data>
  25. <boolean-data :default-value="enableTraffic" title="实时路况" @change="change_enable_traffic"></boolean-data>
  26. <button class="button" @click="addControls">控件</button>
  27. <button class="button" @click="addMarkers">添加标记点</button>
  28. <!-- #ifdef WEB || MP -->
  29. <button class="button" @click="addMarkersLabel">为标记点旁边增加标签</button>
  30. <!-- #endif -->
  31. <button class="button" @click="removeMarker">移除ID为4的标记点和标签</button>
  32. <button class="button" @click="addPolyline">添加路线</button>
  33. <button class="button" @click="removePolyline">移除一条路线</button>
  34. <button class="button" @click="addPolygons">添加多边形</button>
  35. <button class="button" @click="removePolygon">移除一个多边形</button>
  36. <button class="button" @click="addCircles">添加圆</button>
  37. <button class="button" @click="removeCircle">移除一个圆</button>
  38. <button class="button" @click="includePoint">缩放视野以包含所有给定的坐标点</button>
  39. <view class="uni-title">
  40. <text class="uni-title-text">方法示例</text>
  41. </View>
  42. <button class="button" @click="handleGetCenterLocation">获取当前地图中心的经纬度</button>
  43. <button class="button" @click="handleGetRegion">获取当前地图的视野范围</button>
  44. <button class="button" @click="handleTranslateMarker">平移marker</button>
  45. <button class="button" @click="handleMoveToLocation">将地图中心移动到指定坐标</button>
  46. <button class="button" @click="handleMoveToMyLocation">将地图中心移动到当前位置</button>
  47. <button class="button" @click="handleGetScale">获取当前地图的缩放级别</button>
  48. </scroll-view>
  49. </view>
  50. </template>
  51. <script setup lang="uts">
  52. type TypeJestResult = {
  53. translateMarkerMsg : string,
  54. animationEnd : boolean,
  55. centerPoints : LocationObject,
  56. southwest : LocationObject,
  57. northeast : LocationObject,
  58. moveToLocationMsg : string,
  59. scale : number,
  60. eventDetailJsonStringify: string,
  61. }
  62. const testMarkers :Marker[]= [{
  63. id: 0,
  64. latitude: 39.989631,
  65. longitude: 116.481018,
  66. title: '方恒国际 阜通东大街6号',
  67. iconPath: '../../../static/location.png',
  68. rotate: 0,
  69. width: 20,
  70. height: 20,
  71. anchor: {
  72. x: 0.5,
  73. y: 1
  74. } ,
  75. callout: {
  76. content: '方恒国际 阜通东大街6号',
  77. color: '#00BFFF',
  78. fontSize: 10,
  79. borderRadius: 4,
  80. borderWidth: 1,
  81. borderColor: '#333300',
  82. bgColor: '#CCFF99',
  83. padding: 5,
  84. display: 'ALWAYS'
  85. } as MapMarkerCallout
  86. },
  87. {
  88. id: 1,
  89. latitude: 39.9086920000,
  90. longitude: 116.3974770000,
  91. title: '天安门',
  92. // zIndex: '1',
  93. iconPath: '../../../static/location.png',
  94. width: 40,
  95. height: 40,
  96. anchor: {
  97. x: 0.5,
  98. y: 1
  99. },
  100. callout: {
  101. content: '首都北京\n天安门',
  102. color: '#00BFFF',
  103. fontSize: 12,
  104. borderRadius: 10,
  105. borderWidth: 2,
  106. borderColor: '#333300',
  107. bgColor: '#CCFF11',
  108. padding: 5,
  109. display: 'ALWAYS'
  110. } as MapMarkerCallout
  111. },
  112. {
  113. id: 2,
  114. latitude: 39.894793,
  115. longitude: 116.321592,
  116. title: '北京西站',
  117. iconPath: '../../../static/location.png',
  118. width: 40,
  119. height: 40,
  120. anchor: {
  121. x: 0.5,
  122. y: 1
  123. },
  124. callout: {
  125. content: '北京西站',
  126. color: '#ffffff',
  127. fontSize: 12,
  128. borderRadius: 10,
  129. borderWidth: 2,
  130. borderColor: '#333300',
  131. bgColor: '#ff5500',
  132. padding: 5,
  133. display: 'ALWAYS'
  134. } as MapMarkerCallout
  135. },
  136. {
  137. id: 3,
  138. latitude: 39.902344,
  139. longitude: 116.484822,
  140. title: '北京东站',
  141. iconPath: '../../../static/location.png',
  142. width: 20,
  143. height: 20,
  144. anchor: {
  145. x: 0.5,
  146. y: 1
  147. },
  148. callout: {
  149. content: '北京东站',
  150. color: '#ffffff',
  151. fontSize: 12,
  152. borderRadius: 10,
  153. borderWidth: 2,
  154. borderColor: '#333300',
  155. bgColor: '#ff5500',
  156. padding: 5,
  157. display: 'ALWAYS'
  158. } as MapMarkerCallout
  159. },
  160. {
  161. id: 4,
  162. latitude: 39.865011,
  163. longitude: 116.379007,
  164. title: '北京南站',
  165. iconPath: '../../../static/location.png',
  166. width: 40,
  167. height: 40,
  168. anchor: {
  169. x: 0.5,
  170. y: 1
  171. },
  172. callout: {
  173. content: '北京南站',
  174. color: '#ffffff',
  175. fontSize: 12,
  176. borderRadius: 10,
  177. borderWidth: 2,
  178. borderColor: '#333300',
  179. bgColor: '#00aa00',
  180. padding: 5,
  181. display: 'ALWAYS'
  182. } as MapMarkerCallout
  183. },
  184. ];
  185. const testPolyline: Polyline[] = [{
  186. points: [{
  187. latitude: 39.925539,
  188. longitude: 116.279037
  189. },
  190. {
  191. latitude: 39.925539,
  192. longitude: 116.520285
  193. }],
  194. color: '#FFCCFF',
  195. width: 7,
  196. dottedLine: true,
  197. arrowLine: true,
  198. borderColor: '#000000',
  199. borderWidth: 2
  200. },
  201. {
  202. points: [{
  203. latitude: 39.938698,
  204. longitude: 116.275177
  205. },
  206. {
  207. latitude: 39.966069,
  208. longitude: 116.289253
  209. },
  210. {
  211. latitude: 39.944226,
  212. longitude: 116.306076
  213. },
  214. {
  215. latitude: 39.966069,
  216. longitude: 116.322899
  217. },
  218. {
  219. latitude: 39.938698,
  220. longitude: 116.336975
  221. }],
  222. color: '#CCFFFF',
  223. width: 5,
  224. dottedLine: false,
  225. arrowLine: true,
  226. borderColor: '#CC0000',
  227. borderWidth: 3
  228. }
  229. ];
  230. const testPolygons : Polygon[] = [{
  231. points: [{
  232. latitude: 39.781892,
  233. longitude: 116.293413
  234. },
  235. {
  236. latitude: 39.787600,
  237. longitude: 116.391842
  238. },
  239. {
  240. latitude: 39.733187,
  241. longitude: 116.417932
  242. },
  243. {
  244. latitude: 39.704653,
  245. longitude: 116.338255
  246. }],
  247. fillColor: '#FFCCFF',
  248. strokeWidth: 3,
  249. strokeColor: '#CC99CC',
  250. zIndex: 11
  251. },
  252. {
  253. points: [{
  254. latitude: 39.887600,
  255. longitude: 116.518932
  256. },
  257. {
  258. latitude: 39.781892,
  259. longitude: 116.518932
  260. },
  261. {
  262. latitude: 39.781892,
  263. longitude: 116.428932
  264. },
  265. {
  266. latitude: 39.887600,
  267. longitude: 116.428932
  268. }
  269. ],
  270. fillColor: '#CCFFFF',
  271. strokeWidth: 5,
  272. strokeColor: '#CC0000',
  273. zIndex: 3
  274. }
  275. ];
  276. const testCircles: Circle[] = [{
  277. latitude: 39.996441,
  278. longitude: 116.411146,
  279. radius: 15000,
  280. strokeWidth: 5,
  281. color: '#CCFFFF',
  282. fillColor: '#CC0000'
  283. },
  284. {
  285. latitude: 40.096441,
  286. longitude: 116.511146,
  287. radius: 12000,
  288. strokeWidth: 3,
  289. color: '#CCFFFF',
  290. fillColor: '#FFCCFF'
  291. },
  292. {
  293. latitude: 39.896441,
  294. longitude: 116.311146,
  295. radius: 9000,
  296. strokeWidth: 1,
  297. color: '#CCFFFF',
  298. fillColor: '#CC0000'
  299. }
  300. ];
  301. const testIncludePoints :LocationObject[] = [{
  302. latitude: 39.989631,
  303. longitude: 116.481018,
  304. },
  305. {
  306. latitude: 39.9086920000,
  307. longitude: 116.3974770000,
  308. }
  309. ];
  310. const mapContext = ref(null as MapContext | null);
  311. const location = ref({ longitude: 116.39742, latitude: 39.909 } as LocationObject);
  312. const rotate = ref(0);
  313. const skew = ref(0);
  314. // 自动化测试
  315. const autoTest = ref(false);
  316. const updateAutoTest = (value : boolean) => {
  317. autoTest.value = value
  318. }
  319. const jestResult = reactive({
  320. translateMarkerMsg: "",
  321. animationEnd: false,
  322. centerPoints: {
  323. latitude: 0,
  324. longitude: 0
  325. },
  326. southwest: {
  327. latitude: 0,
  328. longitude: 0
  329. },
  330. northeast: {
  331. latitude: 0,
  332. longitude: 0
  333. },
  334. moveToLocationMsg: "",
  335. scale: 0,
  336. eventDetailJsonStringify: "{}"
  337. } as TypeJestResult);
  338. onReady(() => {
  339. mapContext.value = uni.createMapContext("map1", getCurrentInstance()!.proxy!)
  340. });
  341. const scale = ref(13);
  342. const confirm_scale_input = (value : number) => {
  343. scale.value = value
  344. };
  345. const controls = ref([] as Control[]);
  346. const addControls = () => {
  347. controls.value = [{
  348. id: 1,
  349. position: {
  350. left: 5,
  351. top: 180,
  352. width: 30,
  353. height: 30
  354. } as ControlPosition,
  355. iconPath: '../../../static/uni.png',
  356. clickable: true
  357. } as Control]
  358. }
  359. const showLocation = ref(false);
  360. const enable3D = ref(false);
  361. const showCompass = ref(false);
  362. const enableOverlooking = ref(false);
  363. const enableRotate = ref(false);
  364. const enableZoom = ref(true);
  365. const enableScroll = ref(true);
  366. const enableSatellite = ref(false);
  367. const enableTraffic = ref(false);
  368. const change_show_location = (checked : boolean) => {
  369. showLocation.value = checked
  370. }
  371. const change_enable_3d = (checked : boolean) => {
  372. enable3D.value = checked
  373. }
  374. const change_show_campass = (checked : boolean) => {
  375. showCompass.value = checked
  376. }
  377. const change_enable_overlooking = (checked : boolean) => {
  378. enableOverlooking.value = checked
  379. }
  380. const change_enable_rotate = (checked : boolean) => {
  381. enableRotate.value = checked
  382. }
  383. const change_enable_zoom = (checked : boolean) => {
  384. enableZoom.value = checked
  385. }
  386. const change_enable_scroll = (checked : boolean) => {
  387. enableScroll.value = checked
  388. }
  389. const change_enable_satellite = (checked : boolean) => {
  390. enableSatellite.value = checked
  391. }
  392. const change_enable_traffic = (checked : boolean) => {
  393. enableTraffic.value = checked
  394. }
  395. const includePoints = ref([] as LocationObject[]);
  396. const includePoint = () => {
  397. includePoints.value = testIncludePoints;
  398. };
  399. let markers = ref([] as Marker[]);
  400. const addMarkers = () => {
  401. scale.value = 11
  402. const temp = JSON.parse<Marker[]>(JSON.stringify(testMarkers))!
  403. markers.value = temp
  404. };
  405. const removeMarker = () => {
  406. // #ifdef APP
  407. mapContext.value?.removeMarkers({markerIds:[4]})
  408. // #endif
  409. // #ifdef WEB || MP
  410. const index = markers.value.findIndex((marker: Marker):boolean=>{
  411. return marker.id == 4
  412. });
  413. if (index != -1) {
  414. delete markers.value[index].label;
  415. markers.value.splice(index, 1);
  416. } else {
  417. uni.showToast({
  418. title: '未找到该标记点',
  419. icon: 'none'
  420. });
  421. }
  422. // #endif
  423. };
  424. // #ifdef WEB || MP
  425. const addMarkersLabel = () => {
  426. markers.value.forEach((marker, index) => {
  427. marker.label = {
  428. content: 'Hello Label' + (index + 1),
  429. color: '#aa00ff',
  430. fontSize: 12,
  431. x: 5,
  432. y: 0,
  433. borderColor: '#333300',
  434. borderWidth: 2,
  435. borderRadius: 20,
  436. bgColor: '#aaffff',
  437. padding: 10
  438. };
  439. });
  440. };
  441. // #endif
  442. const polyline = ref([] as Polyline[]);
  443. const addPolyline = () => {
  444. scale.value = 11;
  445. polyline.value = JSON.parse<Polyline[]>(JSON.stringify(testPolyline))!;
  446. };
  447. const removePolyline = () => {
  448. if (polyline.value.length > 1) {
  449. polyline.value = JSON.parse<Polyline[]>(JSON.stringify(testPolyline))!.splice(0, 1);
  450. }
  451. };
  452. const polygons = ref([] as Polygon[]);
  453. const addPolygons = () => {
  454. scale.value = 10;
  455. polygons.value = JSON.parse<Polygon[]>(JSON.stringify(testPolygons))!;
  456. };
  457. const removePolygon = () => {
  458. if (polygons.value.length > 1) {
  459. polygons.value = JSON.parse<Polygon[]>(JSON.stringify(testPolygons))!.splice(0, 1);
  460. }
  461. };
  462. const circles = ref([] as Circle[]);
  463. const addCircles = () => {
  464. scale.value = 10;
  465. circles.value = JSON.parse<Circle[]>(JSON.stringify(testCircles))!;
  466. };
  467. const removeCircle = () => {
  468. if (circles.value.length > 1) {
  469. circles.value = JSON.parse<Circle[]>(JSON.stringify(testCircles))!.slice(1);
  470. }
  471. };
  472. const handleGetCenterLocation = () => {
  473. mapContext.value?.getCenterLocation({
  474. success: ret => {
  475. // console.log('getCenterLocation',ret);
  476. jestResult.centerPoints = ret;
  477. if (!autoTest.value) {
  478. uni.showModal({
  479. content: JSON.stringify(ret)
  480. });
  481. }
  482. }
  483. });
  484. };
  485. const handleGetRegion = () => {
  486. mapContext.value?.getRegion({
  487. success: ret => {
  488. // console.log('getRegion',JSON.stringify(ret));
  489. jestResult.southwest = ret.southwest;
  490. jestResult.northeast = ret.northeast
  491. if (!autoTest.value) {
  492. uni.showModal({
  493. content: JSON.stringify(ret)
  494. });
  495. }
  496. }
  497. });
  498. };
  499. const handleTranslateMarker = () => {
  500. mapContext.value?.translateMarker({
  501. markerId: 1,
  502. destination: {
  503. latitude: 39.989631,
  504. longitude: 116.481018
  505. },
  506. autoRotate: true,
  507. rotate: 10,
  508. duration: 2000,
  509. moveWithRotate: true,
  510. // #ifdef WEB || MP
  511. animationEnd: () => {
  512. console.log('动画结束');
  513. jestResult.animationEnd = true;
  514. },
  515. // #endif
  516. success: ret => {
  517. console.log('handleTranslateMarker',JSON.stringify(ret));
  518. const result = ret as UTSJSONObject
  519. jestResult.translateMarkerMsg = result["errMsg"] as string;
  520. },
  521. fail: error => {
  522. console.log(error)
  523. }
  524. });
  525. mapContext.value?.translateMarker({
  526. markerId: 2,
  527. destination: {
  528. latitude: 39.902344,
  529. longitude: 116.484822,
  530. },
  531. autoRotate: true,
  532. rotate: 0,
  533. duration: 2000,
  534. success: ret => {
  535. console.log('handleTranslateMarker', JSON.stringify(ret));
  536. },
  537. fail: error => {
  538. console.log(error)
  539. }
  540. });
  541. };
  542. const handleGetScale = () => {
  543. mapContext.value?.getScale({
  544. success: res => {
  545. // console.log('getScale',res);
  546. scale.value = res.scale
  547. jestResult.scale = res.scale
  548. if (!autoTest.value) {
  549. uni.showModal({
  550. content: '当前地图的缩放级别为:' + res.scale
  551. });
  552. }
  553. },
  554. fail: error => {
  555. console.log(error)
  556. },
  557. });
  558. };
  559. const handleMoveToLocation = () => {
  560. mapContext.value?.moveToLocation({
  561. latitude: 39.909,
  562. longitude: 116.39742,
  563. success: res => {
  564. console.log('moveToLocation',res);
  565. const result = res as UTSJSONObject
  566. jestResult.moveToLocationMsg = result["errMsg"] as string;
  567. if (!autoTest.value) {
  568. uni.showModal({
  569. content: JSON.stringify(res)
  570. });
  571. }
  572. },
  573. fail: error => {
  574. console.log(error)
  575. }
  576. });
  577. };
  578. const handleMoveToMyLocation = () => {
  579. mapContext.value?.moveToLocation({
  580. success: res => {
  581. uni.showModal({
  582. content: '地图中心已经移动到当前位置'
  583. })
  584. },
  585. fail: error => {
  586. console.log(error);
  587. }
  588. })
  589. }
  590. const maptap = (e : UniMapTapEvent) => {
  591. // #ifdef WEB || MP
  592. uni.showModal({
  593. content: 'web端map组件tap事件不支持返回经纬度'
  594. });
  595. // #endif
  596. // #ifndef WEB || MP
  597. // console.log('点击地图时触发',e)
  598. //js运行环境删除多余的信息
  599. // #ifndef APP-ANDROID
  600. Reflect.deleteProperty(e, "target")
  601. Reflect.deleteProperty(e, "currentTarget")
  602. Reflect.deleteProperty(e, "_bubbles")
  603. Reflect.deleteProperty(e, "_cancelable")
  604. Reflect.deleteProperty(e, "timeStamp")
  605. // #endif
  606. uni.showModal({
  607. content: JSON.stringify(e)
  608. });
  609. // #endif
  610. };
  611. const onmarkertap = (e : UniMapMarkerTapEvent) => {
  612. // console.log('点击标记点时触发',e)
  613. //js运行环境删除多余的信息
  614. // #ifndef APP-ANDROID
  615. Reflect.deleteProperty(e, "target")
  616. Reflect.deleteProperty(e, "currentTarget")
  617. Reflect.deleteProperty(e, "_bubbles")
  618. Reflect.deleteProperty(e, "_cancelable")
  619. Reflect.deleteProperty(e, "timeStamp")
  620. // #endif
  621. uni.showModal({
  622. content: JSON.stringify(e)
  623. });
  624. };
  625. const oncontroltap = (e : UniMapControlTapEvent) => {
  626. // console.log('点击控件时触发',e)
  627. uni.showModal({
  628. content: JSON.stringify(e.detail)
  629. });
  630. };
  631. const oncallouttap = (e : UniMapCalloutTapEvent) => {
  632. // console.log('点击标记点对应的气泡时触发',e)
  633. uni.showModal({
  634. content: JSON.stringify(e.detail)
  635. });
  636. };
  637. const onupdated = (e : UniMapUpdatedEvent) => {
  638. console.log('在地图渲染更新完成时触发', e)
  639. };
  640. const onregionchange = (e : UniMapRegionChangeEvent) => {
  641. console.log('视野发生变化时触发', e.detail)
  642. jestResult.eventDetailJsonStringify = JSON.stringify(e.detail)
  643. };
  644. const onpoitap = (e : UniMapPoiTapEvent) => {
  645. // console.log('点击地图poi点时触发',e)
  646. //js运行环境删除多余的信息
  647. // #ifndef APP-ANDROID
  648. Reflect.deleteProperty(e, "target")
  649. Reflect.deleteProperty(e, "currentTarget")
  650. Reflect.deleteProperty(e, "_bubbles")
  651. Reflect.deleteProperty(e, "_cancelable")
  652. Reflect.deleteProperty(e, "timeStamp")
  653. // #endif
  654. uni.showModal({
  655. content: JSON.stringify(e)
  656. });
  657. };
  658. defineExpose({
  659. jestResult,
  660. autoTest,
  661. updateAutoTest,
  662. addControls,
  663. addMarkers,
  664. // #ifdef WEB || MP
  665. addMarkersLabel,
  666. // #endif
  667. removeMarker,
  668. addPolyline,
  669. removePolyline,
  670. addPolygons,
  671. removePolygon,
  672. addCircles,
  673. removeCircle,
  674. includePoint,
  675. handleGetCenterLocation,
  676. handleGetRegion,
  677. handleTranslateMarker,
  678. handleMoveToLocation,
  679. handleGetScale
  680. })
  681. </script>
  682. <style>
  683. .content {
  684. flex: 1;
  685. }
  686. .map {
  687. width: 100%;
  688. height: 300px;
  689. background-color: #f0f0f0;
  690. }
  691. .scrollview {
  692. flex: 1;
  693. padding: 10px;
  694. }
  695. .button {
  696. margin-top: 5px;
  697. margin-bottom: 5px;
  698. }
  699. .tips {
  700. font-size: 12px;
  701. margin-top: 15px;
  702. opacity: .8;
  703. }
  704. </style>