toolMarkPoint.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547
  1. /**
  2. * @fileoverview 工具 在地图上打标记 模块
  3. * @author Song.Huang
  4. * @version 1.0.0
  5. */
  6. define([
  7. 'html!templates/tools/toolMarkPoint',
  8. 'modDir/service/addressSearch',
  9. 'modDir/service/poiSearch',
  10. 'modDir/service/regionSearch',
  11. 'modDir/service/routeSearch',
  12. 'css!styles/tools/toolMarkPoint'
  13. ], function(tplLayout, addressSearchF, poiSearchF, regionSearchF, routeSearchF) {
  14. /**
  15. * 模块数据 用于数据存储和外部调用
  16. * @type {Object}
  17. * 数据存放
  18. */
  19. var modValue = {
  20. markerGroup: null, //marker容器
  21. markers: [], //marker记录
  22. curMarkerGuid: null,
  23. mayFavGuid: {},
  24. markerType: [
  25. map23DConfig.map23DAssetsUrl + '/images/layout/marker/roadsign_type_0.png',
  26. map23DConfig.map23DAssetsUrl + '/images/layout/marker/roadsign_type_1_b.png',
  27. map23DConfig.map23DAssetsUrl + '/images/layout/marker/roadsign_type_1_m.png',
  28. map23DConfig.map23DAssetsUrl + '/images/layout/marker/roadsign_type_1_s.png',
  29. map23DConfig.map23DAssetsUrl + '/images/layout/marker/roadsign_type_2_b.png',
  30. map23DConfig.map23DAssetsUrl + '/images/layout/marker/roadsign_type_2_m.png',
  31. map23DConfig.map23DAssetsUrl + '/images/layout/marker/roadsign_type_2_s.png'
  32. ],
  33. markerTypeIcon: [
  34. map23DConfig.map23DAssetsUrl + '/images/layout/marker/roadsign_icon_0.png',
  35. map23DConfig.map23DAssetsUrl + '/images/layout/marker/roadsign_icon_1_b.png',
  36. map23DConfig.map23DAssetsUrl + '/images/layout/marker/roadsign_icon_1_m.png',
  37. map23DConfig.map23DAssetsUrl + '/images/layout/marker/roadsign_icon_1_s.png',
  38. map23DConfig.map23DAssetsUrl + '/images/layout/marker/roadsign_icon_2_b.png',
  39. map23DConfig.map23DAssetsUrl + '/images/layout/marker/roadsign_icon_2_m.png',
  40. map23DConfig.map23DAssetsUrl + '/images/layout/marker/roadsign_icon_2_s.png'
  41. ],
  42. appendToMyLayer:null
  43. };
  44. /**
  45. * 模块状态,用于存储模块的状态 例如:收起,关闭
  46. * @type {Object}
  47. */
  48. var status = {
  49. initialized: false //是否初始化
  50. };
  51. /**
  52. * 初始化并订阅事件
  53. * @return {[type]} [description]
  54. */
  55. function init() {
  56. if (!status.initialized) {
  57. bindEvent();
  58. subscribe();
  59. status.initialized = true;
  60. modValue.markerGroup = map23DControl.group({
  61. action: 'add'
  62. });
  63. }
  64. map2DViewer.map.on('click', onClickPoint);
  65. ONEMAP.C.publisher.publish({
  66. modName: 'toolMarkPoint'
  67. }, 'tools:active');
  68. };
  69. /**
  70. * 注册监听
  71. * @type {Function}
  72. */
  73. function subscribe() {
  74. ONEMAP.C.publisher.subscribe(clearAllMarker, 'cleanMap');
  75. ONEMAP.C.publisher.subscribe(remove, 'tools:active');
  76. ONEMAP.C.publisher.subscribe(remove, 'change23D');
  77. };
  78. /**
  79. * 移除模块
  80. */
  81. function remove(options) {
  82. if (options.modName != 'toolMarkPoint') {
  83. removeCurClass();
  84. //clearAllMarker();
  85. map2DViewer.map.off('click', onClickPoint);
  86. ONEMAP.M.mapHolder.mouseHand();
  87. } else {
  88. if ($('.tools-marker').hasClass('cur')) {
  89. removeCurClass();
  90. //clearAllMarker();
  91. map2DViewer.map.off('click', onClickPoint);
  92. ONEMAP.M.mapHolder.mouseHand();
  93. } else {
  94. if(modValue.appendToMyLayer){
  95. $('.tools-marker').addClass('cur');
  96. ONEMAP.M.mapHolder.removeMouseHand();
  97. if (L.Browser.ie || L.Browser.firefox) {
  98. map2DViewer.map.getContainer().style.cursor = 'url(' + map23DConfig.map23DAssetsUrl + '/scripts/vendor/map23dlib/images/marker.cur) 12 30,auto';
  99. } else {
  100. map2DViewer.map.getContainer().style.cursor = 'url(' + map23DConfig.map23DAssetsUrl + '/scripts/vendor/map23dlib/images/marker.cur) 12 30,auto';
  101. }
  102. }else{
  103. var layerLength = ONEMAP.M.myLayers.checkLength();
  104. if(layerLength < map23DConfig.layerMaxLength){
  105. $('.tools-marker').addClass('cur');
  106. ONEMAP.M.mapHolder.removeMouseHand();
  107. if (L.Browser.ie || L.Browser.firefox) {
  108. map2DViewer.map.getContainer().style.cursor = 'url(' + map23DConfig.map23DAssetsUrl + '/scripts/vendor/map23dlib/images/marker.cur) 12 30,auto';
  109. } else {
  110. map2DViewer.map.getContainer().style.cursor = 'url(' + map23DConfig.map23DAssetsUrl + '/scripts/vendor/map23dlib/images/marker.cur) 12 30,auto';
  111. }
  112. }else{
  113. ONEMAP.C.publisher.publish({ type: 'warning', message: '图层数量已达上限' }, 'noteBar::add');
  114. }
  115. }
  116. }
  117. }
  118. };
  119. /**
  120. * 样式移除
  121. */
  122. function removeCurClass() {
  123. $('.tools-marker').removeClass('cur');
  124. };
  125. /**
  126. * 填写点数据后保存数据
  127. * @type {Function}
  128. * @param guid {Number} marker的guid
  129. */
  130. function saveMarkerData(guid, address) {
  131. var name = $('#markerAddress').val();
  132. if (name === '' || name === ' ') {
  133. alert('名称不能为空或包含空格');
  134. return false;
  135. }
  136. if ((/[^\a-\z\A-\Z0-9\u4E00-\u9FA5\s]/g).test(name)) {
  137. alert('名称只能包含英文、数字、中文');
  138. return false;
  139. }
  140. map23DData.markers[guid]['adress'] = name;
  141. if (map23DData.markers[guid].markerAddress !== '' && map23DData.markers[guid].markerAddress !== ' ') {
  142. require(['modDir/user/userPoint'], function(userPoint) {
  143. userPoint.addPoint({
  144. name: name,
  145. latlng: map23DData.markers[guid].geojson.geometry.coordinates,
  146. pguid: guid,
  147. type: map2DViewer.markers[guid].markerType
  148. });
  149. });
  150. if (map23DData.display.map2D) {
  151. map2DViewer.markers[guid].closePopup();
  152. } else if (map23DData.display.map3D) {
  153. map3DViewer.markers[guid].closePopup();
  154. }
  155. } else {
  156. alert('名称不能为空值!');
  157. }
  158. };
  159. /**
  160. * 删除点
  161. * @type {Function}
  162. * @param guid {Number} marker的guid
  163. */
  164. function deleteMarker(guid) {
  165. map23DControl.marker({
  166. action: 'remove',
  167. guid: guid
  168. })
  169. };
  170. /**
  171. * 清除所有的点 这里有 工具 栏 模块之间相互通告清除
  172. * @type {Function}
  173. */
  174. function clearAllMarker() {
  175. map23DControl.group({
  176. action: 'cleanAll',
  177. guid: modValue.markerGroup
  178. })
  179. if (modValue.appendToMyLayer) {
  180. var options = {
  181. action: "remove",
  182. DOMid: modValue.appendToMyLayer
  183. }
  184. ONEMAP.M.myLayers.myLayerControl(options);
  185. modValue.appendToMyLayer = false;
  186. }
  187. map2DViewer.map.off('click', onClickPoint);
  188. ONEMAP.M.mapHolder.mouseHand();
  189. /*if (L.Browser.ie || L.Browser.firefox) {
  190. //map2DViewer.map.getContainer().style.cursor = "pointer";
  191. map2DViewer.map.getContainer().style.cursor = 'url('+map23DConfig.map23DAssetsUrl + '/scripts/vendor/map23dlib/images/cur-none.cur),auto';
  192. } else {
  193. //map2DViewer.map.getContainer().style.cursor = "pointer";
  194. map2DViewer.map.getContainer().style.cursor = 'url('+map23DConfig.map23DAssetsUrl + '/scripts/vendor/map23dlib/images/cur-none.cur) 5 5,auto';
  195. }*/
  196. };
  197. /**
  198. * 通过地图缩放等级和坐标查找 地名
  199. * @type {Function}
  200. * @param latLng {Object} 坐标
  201. * @param callBack_func {Function} 回调方法
  202. * @private
  203. */
  204. function getInfoByZoomLatLng(latLng, callBack_func) {
  205. var zoom = map23DData.view.zoom;
  206. var addressSearch = new addressSearchF();
  207. addressSearch.getAddressInfo({ zoom: zoom, latLng: [latLng.lat, latLng.lng] }, function(data) {
  208. ONEMAP.V.loading.loaded();
  209. data = data.data;
  210. callBack_func(data);
  211. });
  212. };
  213. /**
  214. * 图层控制
  215. */
  216. function controlMyLayer(options){
  217. switch (options.action) {
  218. case 'remove':
  219. removeMyLayer();
  220. break;
  221. case 'opacity':
  222. setGropOpacity(options);
  223. break;
  224. }
  225. }
  226. function removeMyLayer(){
  227. clearAllMarker();
  228. removeCurClass();
  229. modValue.appendToMyLayer = null;
  230. }
  231. function setGropOpacity(options){
  232. var options = options.options;
  233. if (options.opacity == 1) {
  234. map23DControl.group({
  235. action: 'show',
  236. guid: modValue.markerGroup
  237. })
  238. } else if (options.opacity == 0) {
  239. map23DControl.group({
  240. action: 'hide',
  241. guid: modValue.markerGroup
  242. })
  243. }
  244. }
  245. /**
  246. * 标记点击修改
  247. * @type {Function}
  248. * @param e
  249. * @private
  250. */
  251. function onClickPoint(e) {
  252. if(!modValue.appendToMyLayer){
  253. var options = {
  254. action: "add",
  255. DOM: {
  256. name: '标记',
  257. type: "group",
  258. guid: modValue.markerGroup
  259. }
  260. }
  261. modValue.appendToMyLayer = ONEMAP.M.myLayers.myLayerControl(options);
  262. ONEMAP.C.publisher.subscribe(controlMyLayer, modValue.appendToMyLayer);
  263. }
  264. createMarker(e);
  265. setTimeout(function() {
  266. $('.marker-build-list span').bind('click', function() {
  267. $('.marker-build-list .select').removeClass('select');
  268. $(this).addClass('select');
  269. });
  270. }, 200);
  271. getInfoByZoomLatLng(e.latlng, function(data) {
  272. var address = data.address.toString();
  273. address = address.replace(/\ /g, "");
  274. modValue.address = address ? address : '未知地点';
  275. $("#markerAddress").val(modValue.address);
  276. });
  277. };
  278. /**
  279. * 创建一个新的标记
  280. * @type {Function}
  281. * @param e
  282. * @returns {L.Marker}
  283. * @private
  284. */
  285. function myFavPoint(e) {
  286. if (!status.initialized) {
  287. init();
  288. ONEMAP.C.publisher.publish({
  289. modName: 'userPoint',
  290. }, 'tools:active');
  291. }
  292. if (modValue.mayFavGuid[e.guid]) {
  293. var latlng = map2DViewer.markers[modValue.mayFavGuid[e.pguid]].getLatLng();
  294. map23DControl.setView({
  295. center: {
  296. lat: latlng.lat,
  297. lng: latlng.lng
  298. }
  299. })
  300. } else {
  301. var iconUrl = modValue.markerTypeIcon[e.type];
  302. var markerId = map23DControl.marker({
  303. action: 'add',
  304. groupId: modValue.markerGroup,
  305. geojson: {
  306. "properties": {
  307. iconUrl: iconUrl,
  308. iconSize: [60, 39],
  309. iconAnchor: [29, 39],
  310. popupAnchor: [0, -39]
  311. },
  312. "geometry": {
  313. "type": "Point",
  314. "coordinates": [e.latlng[1], e.latlng[0]]
  315. }
  316. }
  317. });
  318. modValue.mayFavGuid[e.pguid] = markerId;
  319. modValue.markers.push(markerId);
  320. modValue.curMarkerGuid = markerId;
  321. if (map23DData.display.map2D) {
  322. map2DViewer.markers[markerId].bindPopup(createMarKerPopViewHtml({ address: (this.markerAddress ? this.markerAddress : ' '), guid: this.guid }), { closeButton: false, minWidth: 200, maxWidth: 200 });
  323. map2DViewer.markers[markerId].openPopup();
  324. } else if (map23DData.display.map3D) {
  325. map3DViewer.label({
  326. action: 'update',
  327. guid: markerId,
  328. featureType: 'marker',
  329. label: {
  330. text: e.name, //标牌内容
  331. textColor: '#ffffff', //标牌文字颜色
  332. lineColor: '#ff0000', //标牌引线及边框颜色
  333. background: '#FF0000', //标牌背景颜色
  334. lineTop: 10, //标牌偏移值
  335. lineLeft: 100 //标牌偏移值
  336. }
  337. })
  338. }
  339. }
  340. }
  341. function createMarker(e) {
  342. var markerId = map23DControl.marker({
  343. action: 'add',
  344. groupId: modValue.markerGroup,
  345. geojson: {
  346. "properties": {
  347. iconUrl: map23DConfig.map23DAssetsUrl + '/images/layout/marker/roadsign_icon_0.png',
  348. iconSize: [60, 39],
  349. iconAnchor: [29, 39],
  350. popupAnchor: [0, -39]
  351. },
  352. "geometry": {
  353. "type": "Point",
  354. "coordinates": [e.latlng.lng, e.latlng.lat]
  355. }
  356. }
  357. });
  358. modValue.markers.push(markerId);
  359. modValue.curMarkerGuid = markerId;
  360. if (map23DData.display.map2D) {
  361. map2DViewer.markers[markerId].bindPopup(createMarKerPopHtml({ address: modValue.address, guid: markerId }), { closeButton: false, minWidth: 300, maxWidth: 300 });
  362. map2DViewer.markers[markerId].openPopup();
  363. map2DViewer.markers[markerId].on('click', function() {
  364. this.bindPopup(createMarKerPopViewHtml({ address: (modValue.address ? modValue.address : ' '), guid: this.guid }), { closeButton: false, minWidth: 200, maxWidth: 200 });
  365. this.openPopup();
  366. });
  367. } else if (map23DData.display.map3D) {
  368. }
  369. };
  370. /**
  371. * 创建标记弹出 信息,表单
  372. * @type {Function}
  373. * @param data {Object} 标记数据
  374. * @returns {string}
  375. * @private
  376. */
  377. function createMarKerPopHtml(data) {
  378. var markerData = data;
  379. modValue.curMarkerGuid = markerData.guid;
  380. var container =
  381. '<div class="popup_html">'+
  382. ' <div class="popup-lt"></div>'+
  383. ' <div class="popup-lb"></div>'+
  384. ' <div class="popup-rt"></div>'+
  385. ' <div class="popup-rb"></div>'+
  386. ' <div class="popup-ct">'+
  387. ' <h3 style="font-size:16px;line-height:48px; padding:0px 0 5px 15px; margin-bottom:10px; border-bottom:0px solid #3de0ff">添加新目标</h3>'+
  388. ' </div>'+
  389. ' <div class="popup-cb">'+
  390. ' <div class="marker-form form-horizontal" style="cursor:auto;padding:10px 0px 20px 0px">' +
  391. ' <div class="control-group"> ' +
  392. ' <label class="control-label" style="color:#666666">名称:</label>' +
  393. ' <input id="markerAddress" maxlength="20" class="input" type="text" value="\'' + markerData.address + '\'">' +
  394. ' </div>' +
  395. ' <div class="control-group">' +
  396. ' <label class="control-label" style="color:#666666">图标:</label>'+
  397. ' <div class="marker-build-list icon-list">' +
  398. ' <span><img tid="0" onclick="ONEMAP.M.toolMarkerPoint.changeMarkerType(\'' + markerData.guid + '\',0)" src="' + modValue.markerType[0] + '" /></span>' +
  399. ' <span><img tid="1" onclick="ONEMAP.M.toolMarkerPoint.changeMarkerType(\'' + markerData.guid + '\',1)" src="' + modValue.markerType[1] + '" /></span>' +
  400. ' <span><img tid="2" onclick="ONEMAP.M.toolMarkerPoint.changeMarkerType(\'' + markerData.guid + '\',2)" src="' + modValue.markerType[2] + '" /></span>' +
  401. ' <span><img tid="3" onclick="ONEMAP.M.toolMarkerPoint.changeMarkerType(\'' + markerData.guid + '\',3)" src="' + modValue.markerType[3] + '" /></span>' +
  402. ' <span><img tid="4" onclick="ONEMAP.M.toolMarkerPoint.changeMarkerType(\'' + markerData.guid + '\',4)" src="' + modValue.markerType[4] + '" /></span>' +
  403. ' <span><img tid="5" onclick="ONEMAP.M.toolMarkerPoint.changeMarkerType(\'' + markerData.guid + '\',5)" src="' + modValue.markerType[5] + '" /></span>' +
  404. ' <span><img tid="6" onclick="ONEMAP.M.toolMarkerPoint.changeMarkerType(\'' + markerData.guid + '\',6)" src="' + modValue.markerType[6] + '" /></span>' +
  405. ' </div>'+
  406. ' </div>' + (!ONEMAP.D.user.guest ?
  407. '<div class="text-right submit">' +
  408. '<button type="button" title="保存到 我的收藏-目标 中" onclick="ONEMAP.M.toolMarkerPoint.saveMarkerData(\'' + markerData.guid + '\',\'' + markerData.address + '\')" class="btn save btn3">保存</button>' +
  409. '<button type="button" onclick="ONEMAP.M.toolMarkerPoint.deleteMarker(\'' + markerData.guid + '\')" class="btn delete btn2">取消</button>' +
  410. '</div>' : '') +
  411. ' </div>'+
  412. ' </div>'+
  413. '</div>';
  414. return container;
  415. };
  416. function changeMarkerType(guid, type) {
  417. //if (map23DData.display.map2D) {
  418. map2DViewer.markers[guid].markerType = type;
  419. map23DControl.marker({
  420. action: 'update',
  421. geojson: {
  422. "properties": {
  423. iconUrl: modValue.markerTypeIcon[type]
  424. }
  425. },
  426. guid: guid
  427. })
  428. // } else {
  429. //map3DViewer.markers[guid].markerType = type;
  430. //map3DViewer.marker({
  431. // action: 'update',
  432. // geojson: {
  433. // "properties": {
  434. // iconUrl: modValue.markerTypeIcon[type]
  435. // }
  436. // },
  437. // guid: guid
  438. //})
  439. //}
  440. };
  441. /**
  442. * 创建标记弹出 信息 浏览内容
  443. * @type {Function}
  444. * @param data {Object} 标记数据
  445. * @returns {string}
  446. * @private
  447. */
  448. function createMarKerPopViewHtml(data) {
  449. var markerData = data;
  450. modValue.curMarkerGuid = markerData.guid;
  451. var container =
  452. '<div class="popup_html">' +
  453. ' <div class="popup-lt"></div>' +
  454. ' <div class="popup-lb"></div>' +
  455. ' <div class="popup-rt"></div>' +
  456. ' <div class="popup-rb"></div>' +
  457. ' <div class="popup-ct">' +
  458. ' <p> ' +
  459. ' <strong>' + (markerData.address ? markerData.address : ' ') + '</strong>' +
  460. ' <a class="removemarker" style="position:absolute;right:15px" onclick="ONEMAP.M.toolMarkerPoint.deleteMarker(\'' + markerData.guid + '\')" href="javascript:void(0)">移除</a>' +
  461. ' </p>' +
  462. ' </div>' +
  463. ' <div class="popup-cb">' +
  464. ' <div class="marker-info" style="height:47px;line-height:47px;">' +
  465. ' <div class="op text-right">设为:' +
  466. ' <a onclick="ONEMAP.M.toolMarkerPoint.setStart(\'' + markerData.guid + '\',\'' + markerData.address + '\')" href="javascript:void(0)">起点</a> | ' +
  467. ' <a onclick="ONEMAP.M.toolMarkerPoint.setAcross(\'' + markerData.guid + '\',\'' + markerData.address + '\')" href="javascript:void(0)">途经点</a> | ' +
  468. //'<a onclick="ONEMAP.M.toolMarkerPoint.setAvoid(\'' + markerData.guid + '\',\'' + markerData.address + '\')" href="javascript:void(0)">规避点</a> | ' +
  469. ' <a onclick="ONEMAP.M.toolMarkerPoint.setStop(\'' + markerData.guid + '\',\' ' + markerData.address + '\')" href="javascript:void(0)">终点</a><br/>' +
  470. ' </div>' +
  471. ' </div>'
  472. ' </div>' +
  473. '</div>';
  474. return container;
  475. };
  476. //冒泡窗事件
  477. function setStart(guid, address) {
  478. var data = map23DData.markers[guid];
  479. setDirectionsPoint(data.geojson.geometry.coordinates[1], data.geojson.geometry.coordinates[0], 'start', address);
  480. };
  481. function setAcross(guid, address) {
  482. var data = map23DData.markers[guid];
  483. setDirectionsPoint(data.geojson.geometry.coordinates[1], data.geojson.geometry.coordinates[0], 'across', address);
  484. };
  485. function setAvoid(guid, address) {
  486. var data = map23DData.markers[guid];
  487. setDirectionsPoint(data.geojson.geometry.coordinates[1], data.geojson.geometry.coordinates[0], 'avoid', address);
  488. };
  489. function setStop(guid, address) {
  490. var data = map23DData.markers[guid];
  491. setDirectionsPoint(data.geojson.geometry.coordinates[1], data.geojson.geometry.coordinates[0], 'stop', address);
  492. };
  493. function setDirectionsPoint(_lat, _lng, _type, _name) {
  494. switch (_type) {
  495. case "start":
  496. require(['modDir/tools/toolRouteSearch'], function(toolRouteSearch) {
  497. toolRouteSearch.setStartPoint(new L.LatLng(_lat, _lng), _name);
  498. });
  499. break;
  500. case "across":
  501. require(['modDir/tools/toolRouteSearch'], function(toolRouteSearch) {
  502. toolRouteSearch.setAcrossPoint(new L.LatLng(_lat, _lng), _name);
  503. });
  504. break;
  505. case "avoid":
  506. require(['modDir/tools/toolRouteSearch'], function(toolRouteSearch) {
  507. toolRouteSearch.setAvoidPoint(new L.LatLng(_lat, _lng), _name);
  508. });
  509. break;
  510. case "stop":
  511. require(['modDir/tools/toolRouteSearch'], function(toolRouteSearch) {
  512. toolRouteSearch.setStopPoint(new L.LatLng(_lat, _lng), _name);
  513. });
  514. break;
  515. }
  516. $("#routSearchContent").show();
  517. };
  518. function bindEvent() {};
  519. return ONEMAP.M.toolMarkerPoint = {
  520. init: init,
  521. setStop: setStop,
  522. setAvoid: setAvoid,
  523. setAcross: setAcross,
  524. setStart: setStart,
  525. deleteMarker: deleteMarker,
  526. changeMarkerType: changeMarkerType,
  527. saveMarkerData: saveMarkerData,
  528. myFavPoint: myFavPoint
  529. }
  530. })