toolPlaceSearch2.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. define([
  2. 'html!templates/tools/toolPlaceSearch',
  3. 'modDir/service/addressSearch',
  4. 'modDir/service/poiSearch',
  5. 'modDir/service/routeSearch',
  6. 'text!data/address_baike/db.json',
  7. 'css!styles/tools/toolPlaceSearch'
  8. ], function(tpcLayout, addressSearchF, poiSearchF,routeSearchF,addressBaikeDb) {
  9. /**
  10. * 索引函数
  11. */
  12. if (!Array.prototype.indexOf) {
  13. Array.prototype.indexOf = function(elt, from) {
  14. var len = this.length;
  15. var from = Number(arguments[1]) || 0;
  16. from = (from < 0) ? Math.ceil(from) : Math.floor(from);
  17. if (from < 0) {
  18. from += len;
  19. }
  20. for (; from < len; from++) {
  21. if (from in this && this[from] === elt) {
  22. return from;
  23. }
  24. return -1;
  25. }
  26. }
  27. }
  28. /**
  29. * 模块数据 用于数据存储和外部调用
  30. * @type {Object}
  31. * 数据存放
  32. */
  33. var modValue = {
  34. markers:{},
  35. options: {
  36. page: 1,
  37. bounds: null,
  38. pageSize: 10,
  39. keyWord: '',
  40. type: 'bounds', // bounds/dis
  41. center: null, //中心点
  42. dis: 0, //圆范围
  43. themeId: null, //类型
  44. pac: 0, //区域pac
  45. init_query_key: '' //原始查询关键字
  46. },
  47. initialized: false, //是否初始化
  48. placeDataResult: null, //查询数据集合
  49. fitBounds: true, //最优显示
  50. circleGroup: null, //圆容器
  51. searchCircle:null,
  52. searchPoup:null,
  53. markerGroup: null, //标记容器
  54. hotPoint: [] //常用热点关键字
  55. };
  56. })