UNPKG

kgis

Version:

a lib of kgis

1 lines 322 kB
!function(n){var r={};function e(a){if(r[a])return r[a].exports;var t=r[a]={i:a,l:!1,exports:{}};return n[a].call(t.exports,t,t.exports,e),t.l=!0,t.exports}e.m=n,e.c=r,e.d=function(n,r,a){e.o(n,r)||Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:a})},e.r=function(n){Object.defineProperty(n,"__esModule",{value:!0})},e.n=function(n){var r=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(r,"a",r),r},e.o=function(n,r){return Object.prototype.hasOwnProperty.call(n,r)},e.p="",e(e.s="./src/init.js")}({"./node_modules/webpack/buildin/global.js":function(module,exports){eval('var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || Function("return this")() || (1, eval)("this");\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === "object") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it\'s\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n\n\n//# sourceURL=webpack:///(webpack)/buildin/global.js?')},"./src/config/config.js":function(module,exports,__webpack_require__){eval('const Const = __webpack_require__(/*! ./../util/const */ "./src/util/const.js");\r\n\r\nmodule.exports = {\r\n amap: {\r\n mapType: Const.AMAP_MAP_TYPE,\r\n version: Const.AMAP_VERSION,\r\n url: Const.AMAP_URL + Const.AMAP_VERSION + Const.AMAP_URL_TEMP,\r\n key: Const.AMAP_KEY,\r\n time: Const.AMAP_TIME,\r\n language: Const.AMAP_LANGUAGE\r\n },\r\n bmap: {\r\n mapType: Const.BMAP_MAP_TYPE,\r\n version: Const.BMAP_VERSION,\r\n url: Const.BMAP_URL + Const.BMAP_VERSION + Const.BMAP_URL_TEMP,\r\n key: Const.BMAP_KEY,\r\n time: Const.BMAP_TIME,\r\n language: Const.BMAP_LANGUAGE\r\n },\r\n arcgis: {\r\n mapType: Const.ARCGIS_MAP_TYPE,\r\n version: Const.ARCGIS_VERSION,\r\n url: Const.ARCGIS_URL,\r\n key: Const.ARCGIS_KEY,\r\n time: Const.ARCGIS_TIME,\r\n language: Const.ARCGIS_LANGUAGE\r\n },\r\n gmap: {\r\n mapType: Const.GMAP_MAP_TYPE,\r\n version: Const.GMAP_VERSION,\r\n url: Const.GMAP_URL,\r\n key: Const.GMAP_KEY,\r\n time: Const.GMAP_TIME,\r\n language: Const.GMAP_LANGUAGE\r\n }\r\n};\r\n\n\n//# sourceURL=webpack:///./src/config/config.js?')},"./src/factory/config-factory.js":function(module,exports,__webpack_require__){eval('let Const = __webpack_require__(/*! ./../util/const */ "./src/util/const.js");\r\n\r\nclass ConfigFactory {\r\n constructor(){\r\n this.version = Const.VERSION; // 版本\r\n this.description = Const.DESCRIPTION; // 描述\r\n this.author = Const.AUTHOR; // 作者\r\n this.blog = Const.BLOG; // 博客\r\n this.website = Const.WEBSITE; // 网站主页\r\n this.qq = Const.QQ; // QQ\r\n this.wechat = Const.WECHAT; // 微信\r\n this.github = Const.GITHUB; // GitHub\r\n this.jianshu = Const.JIANSHU; // 简书\r\n this.email = Const.EMAIL; // 邮箱\r\n }\r\n}\r\n\r\nmodule.exports = ConfigFactory;\n\n//# sourceURL=webpack:///./src/factory/config-factory.js?')},"./src/factory/map/controller-factory.js":function(module,exports){eval("class ControllerFactory {\r\n constructor(){\r\n\r\n }\r\n\r\n addControl(){\r\n throw '\"' + this.constructor.name + \"'类没有addControl()方法\";\r\n }\r\n\r\n removeControl(){\r\n throw '\"' + this.constructor.name + \"'类没有removeControl()方法\";\r\n }\r\n}\r\n\r\nmodule.exports = ControllerFactory;\n\n//# sourceURL=webpack:///./src/factory/map/controller-factory.js?")},"./src/factory/map/event-factory.js":function(module,exports){eval("class EventFactory {\r\n constructor(){\r\n\r\n }\r\n\r\n bind(){\r\n throw '\"' + this.constructor.name + \"'类没有bind()方法\";\r\n }\r\n\r\n unbind(){\r\n throw '\"' + this.constructor.name + \"'类没有unbind()方法\";\r\n }\r\n\r\n isbind(){\r\n throw '\"' + this.constructor.name + \"'类没有isbind()方法\";\r\n }\r\n}\r\n\r\nmodule.exports = EventFactory;\n\n//# sourceURL=webpack:///./src/factory/map/event-factory.js?")},"./src/factory/map/geocoder-factory.js":function(module,exports){eval("class GeocoderFactory {\r\n constructor(){\r\n\r\n }\r\n\r\n getPointByAddress(){\r\n throw '\"' + this.constructor.name + \"'类没有locationByLnglat()方法\";\r\n }\r\n\r\n getLocationByPoint(){\r\n throw '\"' + this.constructor.name + \"'类没有locationByPoint()方法\";\r\n }\r\n}\r\n\r\nmodule.exports = GeocoderFactory;\n\n//# sourceURL=webpack:///./src/factory/map/geocoder-factory.js?")},"./src/factory/map/infowindow-factory.js":function(module,exports){eval("class InfowindowFactory {\r\n constructor(){\r\n\r\n }\r\n\r\n openInfoWindow(){\r\n throw '\"' + this.constructor.name + \"'类没有openInfoWindow()方法\";\r\n }\r\n}\r\n\r\nmodule.exports = InfowindowFactory;\n\n//# sourceURL=webpack:///./src/factory/map/infowindow-factory.js?")},"./src/factory/map/layer-factory.js":function(module,exports){eval("class LayerFactory {\r\n constructor(){\r\n\r\n }\r\n\r\n test(){\r\n throw '\"' + this.constructor.name + \"'类没有test()方法\";\r\n }\r\n}\r\n\r\nmodule.exports = LayerFactory;\n\n//# sourceURL=webpack:///./src/factory/map/layer-factory.js?")},"./src/factory/map/location-factory.js":function(module,exports){eval("class LocationFactory {\r\n constructor(){\r\n\r\n }\r\n\r\n locationByLnglat(){\r\n throw '\"' + this.constructor.name + \"'类没有locationByLnglat()方法\";\r\n }\r\n\r\n locationByPoint(){\r\n throw '\"' + this.constructor.name + \"'类没有locationByPoint()方法\";\r\n }\r\n}\r\n\r\nmodule.exports = LocationFactory;\n\n//# sourceURL=webpack:///./src/factory/map/location-factory.js?")},"./src/factory/map/map-factory.js":function(module,exports){eval("class MapFactory {\r\n constructor(){\r\n\r\n }\r\n\r\n getMap(){\r\n throw '\"' + this.constructor.name + \"'类没有getMap()方法\";\r\n }\r\n\r\n setMapType(){\r\n throw '\"' + this.constructor.name + \"'类没有setMapType()方法\";\r\n }\r\n\r\n zoomIn(){\r\n throw '\"' + this.constructor.name + \"'类没有zoomIn()方法\";\r\n }\r\n\r\n zoomOut(){\r\n throw '\"' + this.constructor.name + \"'类没有zoomOut()方法\";\r\n }\r\n\r\n enableDoubleClickZoom(){\r\n throw '\"' + this.constructor.name + \"'类没有enableDoubleClickZoom()方法\";\r\n }\r\n\r\n disableDoubleClickZoom(){\r\n throw '\"' + this.constructor.name + \"'类没有disableDoubleClickZoom()方法\";\r\n }\r\n\r\n centerAndZoom(){\r\n throw '\"' + this.constructor.name + \"'类没有centerAndZoom()方法\";\r\n }\r\n\r\n centerAndZoomByCity(){\r\n throw '\"' + this.constructor.name + \"'类没有centerAndZoomByCity()方法\";\r\n }\r\n\r\n centerAndZoomByPoint(){\r\n throw '\"' + this.constructor.name + \"'类没有centerAndZoomByPoint()方法\";\r\n }\r\n\r\n panTo(){\r\n throw '\"' + this.constructor.name + \"'类没有panTo()方法\";\r\n }\r\n\r\n setDrag(){\r\n throw '\"' + this.constructor.name + \"'类没有setDrag()方法\";\r\n }\r\n}\r\n\r\nmodule.exports = MapFactory;\n\n//# sourceURL=webpack:///./src/factory/map/map-factory.js?")},"./src/factory/map/measure-factory.js":function(module,exports){eval("class MeasureFactory {\r\n constructor(){\r\n\r\n }\r\n\r\n newMeasureLine(){\r\n throw '\"' + this.constructor.name + \"'类没有newMeasureLine()方法\";\r\n }\r\n\r\n openMeasureLine(){\r\n throw '\"' + this.constructor.name + \"'类没有openMeasureLine()方法\";\r\n }\r\n\r\n closeMeasureLine(){\r\n throw '\"' + this.constructor.name + \"'类没有closeMeasureLine()方法\";\r\n }\r\n\r\n newMeasureArea(){\r\n throw '\"' + this.constructor.name + \"'类没有newMeasureArea()方法\";\r\n }\r\n\r\n openMeasureArea(){\r\n throw '\"' + this.constructor.name + \"'类没有openMeasureArea()方法\";\r\n }\r\n\r\n closeMeasureArea(){\r\n throw '\"' + this.constructor.name + \"'类没有closeMeasureArea()方法\";\r\n }\r\n}\r\n\r\nmodule.exports = MeasureFactory;\n\n//# sourceURL=webpack:///./src/factory/map/measure-factory.js?")},"./src/factory/map/menu-factory.js":function(module,exports){eval("class MenuFactory {\r\n constructor(){\r\n\r\n }\r\n\r\n test(){\r\n throw '\"' + this.constructor.name + \"'类没有test()方法\";\r\n }\r\n}\r\n\r\nmodule.exports = MenuFactory;\n\n//# sourceURL=webpack:///./src/factory/map/menu-factory.js?")},"./src/factory/map/overlay-factory.js":function(module,exports){eval("class OverlayFactory {\r\n constructor(){\r\n\r\n }\r\n\r\n enableEditing(){\r\n throw '\"' + this.constructor.name + \"'类没有enableEditing()方法\";\r\n }\r\n\r\n addOverlay(){\r\n throw '\"' + this.constructor.name + \"'类没有addOverlay()方法\";\r\n }\r\n\r\n removeOverlay(){\r\n throw '\"' + this.constructor.name + \"'类没有removeOverlay()方法\";\r\n }\r\n\r\n clearOverlays(){\r\n throw '\"' + this.constructor.name + \"'类没有clearOverlays()方法\";\r\n }\r\n\r\n}\r\n\r\nmodule.exports = OverlayFactory;\n\n//# sourceURL=webpack:///./src/factory/map/overlay-factory.js?")},"./src/factory/map/service-factory.js":function(module,exports){eval("class ServiceFactory {\r\n constructor(){\r\n\r\n }\r\n\r\n test(){\r\n throw '\"' + this.constructor.name + \"'类没有test()方法\";\r\n }\r\n}\r\n\r\nmodule.exports = ServiceFactory;\n\n//# sourceURL=webpack:///./src/factory/map/service-factory.js?")},"./src/init.js":function(module,exports,__webpack_require__){eval('/* WEBPACK VAR INJECTION */(function(global) {const Parse = __webpack_require__(/*! ./sys/parse */ "./src/sys/parse.js");\r\nconst Common = __webpack_require__(/*! ./util/common */ "./src/util/common.js");\r\nconst Const = __webpack_require__(/*! ./util/const */ "./src/util/const.js");\r\n\r\nclass KGIS {\r\n\r\n constructor(){\r\n this.maptype = "";\r\n }\r\n\r\n /**\r\n * @apiDefine AGis 介绍\r\n */\r\n /**\r\n * @api {introduction} 统一接口框架的介绍\r\n * @apiName gis\r\n * @apiGroup AGis\r\n * @apiVersion 0.0.1\r\n * @apiDescription <p>统一接口框架(v0.2.0)现在包括地图模块(Map)、控件模块(Controller)、定位模块(Location)、测量模块(Measure)、事件模块(Event)、标注模块(Overlay)、菜单模块(Menu)、弹窗模块(InfoWindow),统一接口支持模块化引用,但是【地图模块】和【控件模块】必须要引用,其他根据项目需求选择引用。</p>\r\n * <p>第二个段落</p>\r\n * <p>第三个段落</p>\r\n *\r\n * @apiParam {module} Map 地图模块.\r\n * @apiParam {module} Controller 控件模块.\r\n * @apiParam {module} Location 定位模块.\r\n * @apiParam {module} Measure 测量模块.\r\n * @apiParam {module} Event 事件模块.\r\n * @apiParam {module} Overlay 标注模块.\r\n * @apiParam {module} Menu 菜单模块.\r\n * @apiParam {module} InfoWindow 弹窗模块.\r\n *\r\n */\r\n\r\n\r\n /**\r\n * @apiDefine BInit 初始化类\r\n */\r\n /**\r\n * @api {config} 通过配置文件形式声明地图类型\r\n * @apiName ii1\r\n * @apiGroup BInit\r\n * @apiVersion 0.0.1\r\n * @apiDescription 两种设置地图类型的方式一:通过配置文件声明的形式设置地图类型\r\n *\r\n * @apiParam {file} config 放在引用kgis.js的index.html文件的assets文件夹下,如:[ProjectRootPath]/assets/config.json\r\n *\r\n * @apiExample {init} 使用示例:\r\n * // config.json文件中内容如下:\r\n * {\r\n * \t"project":"demo",\r\n * \t"describe":"a demo of using KGIS SDK",\r\n * \t"mapType":"bmap",\r\n * \t"sdkVersion":"0.0.1",\r\n * \t"projectVersion":"0.0.1"\r\n * }\r\n *\r\n */\r\n\r\n /**\r\n * @api {mapType} 通过变量形式声明地图类型\r\n * @apiName ii2\r\n * @apiGroup BInit\r\n * @apiVersion 0.0.1\r\n * @apiDescription 两种设置地图类型的方式二:通过变量声明的形式设置地图类型\r\n * <p><b>提示:</b>可以通过设置MAPTYPE来覆盖config.json中的地图配置参数</p>\r\n *\r\n * @apiParam {string} MAPTYPE 支持amap、bmap、gmap和arcgis等地图类型,如果config.json和MAPTYPE同时设置了,则会覆盖config.json中的配置\r\n *\r\n * @apiExample {init} 使用示例:\r\n * MAPTYPE = "amap"; // 在KGIS.init()方法之前声明即可\r\n *\r\n */\r\n\r\n /**\r\n * @api {get} init(modules,callback) 系统初始化\r\n * @apiName init\r\n * @apiGroup BInit\r\n * @apiVersion 0.0.1\r\n * @apiDescription 地图初始化。为了减少资源消耗,框架采用模块化加载\r\n *\r\n * @apiParam {array} modules 传入功能模块,支持模块包括Map、Controller、Location、Measure、Event、Overlay、Menu、InfoWindow,其中Map、Controller为必选,必须填写.\r\n * @apiParam {function} callback 完成地图初始化的回调函数.\r\n *\r\n * @apiExample {init} 使用示例:\r\n * let modules = ["Map", "Controller", "Location", "Measure", "Event", "Overlay", "Menu", "InfoWindow"];\r\n * let options = {\r\n * lng:117,\r\n * lat:36,\r\n * level:11,\r\n * mapType:"hybird"\r\n * };\r\n * KGIS.init(modules, function(){\r\n * // 业务逻辑入口\r\n * let map = new KGIS.Map("allmap", options);// allmap是div的id\r\n * });\r\n *\r\n */\r\n init(modules, callback) {\r\n\r\n if (!Common.inArray(modules, "Map")) {\r\n throw "必须要加载Map模块!";\r\n }\r\n if (!Common.inArray(modules, "Controller")) {\r\n throw "必须要加载Controller模块!";\r\n }\r\n\r\n this.modules = modules;\r\n\r\n if (typeof(KGIS.Map) === "undefined") {\r\n // 调用后拿到Map对象(AMap,BMap等)\r\n this.initKey();\r\n\r\n // 调用进行初始化地图\r\n this.initModules(modules, callback, false);\r\n }else {\r\n this.initModules(modules, callback, true);\r\n }\r\n\r\n }\r\n\r\n /*\r\n * @api {get} initKey() 初始化应用的key\r\n * @apiName initKey\r\n * @apiGroup Init\r\n * @apiVersion 0.0.1\r\n * @apiDescription 初始化应用的key.\r\n *\r\n * @apiExample {initKey} 使用示例:\r\n * KGIS.initKey();\r\n */\r\n initKey() {\r\n let res = Parse.getUrl();\r\n\r\n this.maptype = res[1];\r\n\r\n Common.loadJsScriptToHead(res[0]);\r\n\r\n // 防止ionic的main.css中的img样式改变弹窗的关闭按钮和弹框的阴影效果\r\n let sty = `\r\n .BMap_pop > img{\r\n max-width: unset !important;\r\n }\r\n .BMap_shadow > div > img{\r\n max-width: unset !important;\r\n }\r\n `;\r\n Common.loadStrCssToHead(sty);\r\n\r\n }\r\n\r\n /*\r\n * @api {get} initModules(modules,callback) 地图初始化\r\n * @apiName initModules\r\n * @apiGroup Init\r\n * @apiVersion 0.0.1\r\n * @apiDescription 地图初始化.\r\n *\r\n * @apiParam {string} id 传入地图id.\r\n * @apiParam {object} options 传入经度、纬度、缩放层级等.\r\n * @apiParam {array} modules 传入功能模块.\r\n * @apiParam {function} callback 完成地图初始化的回调函数.\r\n * @apiParam {boolean} flag 设置地图组件是否已经加载好了,true表示已经加载好了,不需要再初始化key了\r\n *\r\n * @apiExample {initModules} 使用示例:\r\n * let modules = ["Map","Controller","Event","Menu"];\r\n * let options = {\r\n * lng:117,\r\n * lat:36,\r\n * level:11,\r\n * mapType:"hybird"\r\n * };\r\n * KGIS.initModules("allmap",options,modules,callback,true); // allmap是div的id,地图组件已经初始化了,不需要再初始化了\r\n *\r\n */\r\n initModules(modules, callback, flag) {\r\n let pMapType = this.maptype.toLocaleLowerCase();\r\n if (!(pMapType === Const.AMAP || pMapType === Const.BMAP || pMapType === Const.GMAP)) {\r\n throw "参数错误: [当前html页面]/assets/config.json中的mapType只允许\'amap\'、\'bmap\'和\'gmap\',且不区分大小写";\r\n }\r\n\r\n if (pMapType === Const.BMAP){\r\n window.HOST_TYPE = "2"; // v2.0显示的\r\n window.BMap_loadScriptTime = (new Date).getTime(); // 2.0和3.0都有\r\n window.BMAP_PROTOCOL = window.location.protocol.substring(0, window.location.protocol.length-1); // 2.0和3.0都有\r\n }\r\n\r\n let _this = this;\r\n // 是否已经初始化Map了\r\n if (!flag) {\r\n // 页面是否已经完成了加载,但是没有初始化Map\r\n if (document.readyState === "complete") {\r\n this.loadPortal(pMapType, modules, callback);\r\n }\r\n window.onload = function () {\r\n // 页面还没加载,也没有初始化Map\r\n _this.loadPortal(pMapType, modules, callback);\r\n };\r\n }else {\r\n // 页面已经初始化,而且Map已经加载了\r\n this.loadPortal(pMapType, modules, callback);\r\n }\r\n\r\n }\r\n\r\n /*\r\n * @api {get} loadPortal(projectConfig, modules, callback) 地图初始化\r\n * @apiName loadPortal\r\n * @apiGroup Init\r\n * @apiVersion 0.0.1\r\n * @apiDescription 地图初始化.\r\n *\r\n * @apiParam {object} options 传入经度、纬度、缩放层级等.\r\n * @apiParam {array} modules 传入功能模块.\r\n * @apiParam {function} callback 完成地图初始化的回调函数.\r\n * @apiParam {boolean} flag 设置地图组件是否已经加载好了,true表示已经加载好了,不需要再初始化key了\r\n *\r\n * @apiExample {loadPortal} 使用示例:\r\n * let modules = ["Map","Controller","Event","Menu"];\r\n * let options = {\r\n * lng:117,\r\n * lat:36,\r\n * level:11,\r\n * mapType:"hybird"\r\n * };\r\n * KGIS.loadPortal(projectConfig ,"allmap",options,modules,callback,true); // allmap是div的id,地图组件已经初始化了,不需要再初始化了\r\n *\r\n */\r\n loadPortal(mapType, modules, callback){\r\n switch (mapType) {\r\n case Const.AMAP:\r\n // 选择加载高德地图 amap.js\r\n global.KGIS = __webpack_require__(/*! ./map/amap */ "./src/map/amap.js");\r\n break;\r\n case Const.BMAP:\r\n // 选择加载百度地图 bmap.js\r\n if (this.maptype === Const.BMAP) {\r\n // 引入测量工具模块、测面工具、测面方法\r\n __webpack_require__(/*! ./util/bmeasure */ "./src/util/bmeasure.js");\r\n }\r\n global.KGIS = __webpack_require__(/*! ./map/bmap */ "./src/map/bmap.js");\r\n break;\r\n case Const.ARCGIS:\r\n // 选择加载ArcGIS arcgis.js\r\n global.KGIS = __webpack_require__(/*! ./map/arcgis */ "./src/map/arcgis.js");\r\n break;\r\n case Const.GMAP:\r\n // 选择加载Google google.js\r\n global.KGIS = __webpack_require__(/*! ./map/gmap */ "./src/map/gmap.js");\r\n break;\r\n }\r\n global.KGIS.maptype = mapType;\r\n if (global.KGIS.Map !== undefined){\r\n callback();\r\n }else {\r\n throw "地图组件初始化失败,请检查一下KGIS.init(...)方法!";\r\n }\r\n }\r\n}\r\n\r\n// 使用 global 对需要暴露的接口进行暴露\r\nglobal.KGIS = new KGIS();\r\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))\n\n//# sourceURL=webpack:///./src/init.js?')},"./src/map/amap.js":function(module,exports,__webpack_require__){eval('let ConfigFactory = __webpack_require__(/*! ../factory/config-factory */ "./src/factory/config-factory.js");\r\n\r\n/**\r\n * @apiDefine Map 地图类\r\n */\r\nclass kGIS extends ConfigFactory {\r\n\r\n /*\r\n * @api {get} constructor(map) 构造函数\r\n * @apiName constructor\r\n * @apiGroup Map\r\n * @apiVersion 0.0.1\r\n * @apiDescription 构造函数\r\n *\r\n * @apiParam {object} map 定义的属性map.\r\n *\r\n */\r\n constructor() {\r\n super();\r\n\r\n this.map = "";\r\n this.maptype = "";\r\n\r\n // 还未初始化,就加载模块,反之\r\n if (typeof(KGIS.Map) === "undefined") {\r\n // 模块化加载组件\r\n for (let module of KGIS.modules) {\r\n switch (module) {\r\n case "Map":\r\n this.Map = __webpack_require__(/*! ./amap/obj/map */ "./src/map/amap/obj/map.js");\r\n this.Point = __webpack_require__(/*! ./amap/obj/point */ "./src/map/amap/obj/point.js");\r\n break;\r\n case "Controller":\r\n this.Controller = __webpack_require__(/*! ./amap/controller */ "./src/map/amap/controller.js");\r\n this.Scale = __webpack_require__(/*! ./amap/obj/scale */ "./src/map/amap/obj/scale.js");\r\n this.ToolBar = __webpack_require__(/*! ./amap/obj/toolbar */ "./src/map/amap/obj/toolbar.js");\r\n this.OverView = __webpack_require__(/*! ./amap/obj/overview */ "./src/map/amap/obj/overview.js");\r\n break;\r\n case "Location":\r\n this.Location = __webpack_require__(/*! ./amap/location */ "./src/map/amap/location.js");\r\n break;\r\n case "Measure":\r\n this.Measure = __webpack_require__(/*! ./amap/measure */ "./src/map/amap/measure.js");\r\n break;\r\n case "Event":\r\n this.Event = __webpack_require__(/*! ./amap/event */ "./src/map/amap/event.js");\r\n break;\r\n case "Layer":\r\n this.Layer = __webpack_require__(/*! ./amap/layer */ "./src/map/amap/layer.js");\r\n break;\r\n case "Overlay":\r\n this.Overlay = __webpack_require__(/*! ./amap/overlay */ "./src/map/amap/overlay.js");\r\n this.Marker = __webpack_require__(/*! ./amap/obj/marker */ "./src/map/amap/obj/marker.js");\r\n this.Polyline = __webpack_require__(/*! ./amap/obj/polyline */ "./src/map/amap/obj/polyline.js");\r\n this.Polygon = __webpack_require__(/*! ./amap/obj/polygon */ "./src/map/amap/obj/polygon.js");\r\n this.Icon = __webpack_require__(/*! ./amap/obj/icon */ "./src/map/amap/obj/icon.js");\r\n this.Size = __webpack_require__(/*! ./amap/obj/size */ "./src/map/amap/obj/size.js");\r\n this.Label = __webpack_require__(/*! ./amap/obj/label */ "./src/map/amap/obj/label.js");\r\n break;\r\n case "Menu":\r\n this.Menu = __webpack_require__(/*! ./amap/menu */ "./src/map/amap/menu.js");\r\n break;\r\n case "InfoWindow":\r\n this.InfoWindow = __webpack_require__(/*! ./amap/obj/infowindow */ "./src/map/amap/obj/infowindow.js");\r\n break;\r\n }\r\n }\r\n }\r\n\r\n }\r\n}\r\n\r\nmodule.exports = new kGIS();\r\n\n\n//# sourceURL=webpack:///./src/map/amap.js?')},"./src/map/amap/controller.js":function(module,exports,__webpack_require__){eval('const ControllerFactory = __webpack_require__(/*! ../../factory/map/controller-factory */ "./src/factory/map/controller-factory.js");\r\n/**\r\n * @apiDefine DController 控件类\r\n */\r\nclass Controller extends ControllerFactory{\r\n /*\r\n * @api {get} constructor() 构造函数\r\n * @apiName constructor\r\n * @apiGroup DController\r\n * @apiVersion 0.0.1\r\n * @apiDescription 构造函数\r\n *\r\n */\r\n constructor() {\r\n super();\r\n }\r\n\r\n /**\r\n * @api {get} addControl(control) 添加控件\r\n * @apiName addControl\r\n * @apiGroup DController\r\n * @apiVersion 0.0.1\r\n * @apiDescription 添加控件\r\n *\r\n * @apiParam {object} control 需要添加的控件\r\n *\r\n * @apiExample {addControl} 使用示例:\r\n * let map = new KGIS.Map();\r\n * let controller = new KGIS.Controller();\r\n * let scale = controller.newScale("leftbottom");\r\n * map.addControl(scale);\r\n *\r\n */\r\n addControl(control) {\r\n KGIS.map.addControl(control);\r\n control.show();\r\n };\r\n\r\n /**\r\n * @api {get} removeControl(control) 移除控件\r\n * @apiName removeControl\r\n * @apiGroup DController\r\n * @apiVersion 0.0.1\r\n * @apiDescription 移除控件\r\n *\r\n * @apiParam {object} control 需要移除的控件\r\n *\r\n * @apiExample {removeControl} 使用示例:\r\n * let map = new KGIS.Map();\r\n * let controller = new KGIS.Controller();\r\n * let scale = controller.newScale("leftbottom");\r\n * map.addControl(scale);\r\n * map.removeControl(scale);\r\n *\r\n */\r\n removeControl(control) {\r\n KGIS.map.removeControl(control);\r\n control.hide();\r\n };\r\n\r\n /*\r\n * @api {get} getPosition(position) 控件位置\r\n * @apiName getPosition\r\n * @apiGroup DController\r\n * @apiVersion 0.0.1\r\n * @apiDescription 控件位置\r\n *\r\n * @apiParam {string} position 支持左下(leftbottom),左上(lefttop),右下(rightbottom),右上(righttop)四个方位\r\n *\r\n * @apiExample {getPosition} 使用示例:\r\n * let controller = new KGIS.Controller();\r\n * let position = controller.getPosition("leftbottom");\r\n *\r\n */\r\n static getPosition(position) {\r\n let apos = "RB"; // 默认右下角\r\n switch (position) {\r\n case "leftbottom":\r\n apos = "LB";\r\n break;\r\n case "lefttop":\r\n apos = "LT";\r\n break;\r\n case "rightbottom":\r\n apos = "RB";\r\n break;\r\n case "righttop":\r\n apos = "RT";\r\n break;\r\n }\r\n return apos;\r\n }\r\n}\r\n\r\nmodule.exports = Controller;\r\n\n\n//# sourceURL=webpack:///./src/map/amap/controller.js?')},"./src/map/amap/event.js":function(module,exports,__webpack_require__){eval('const EventFactory = __webpack_require__(/*! ../../factory/map/event-factory */ "./src/factory/map/event-factory.js");\r\n/**\r\n * @apiDefine Event 事件类\r\n */\r\nclass Event extends EventFactory{\r\n /*\r\n * @api {get} constructor(measureLine,measureArea) 构造函数\r\n * @apiName constructor\r\n * @apiGroup Event\r\n * @apiVersion 0.0.1\r\n * @apiDescription 构造函数\r\n *\r\n */\r\n constructor() {\r\n super();\r\n this.event_array = {};\r\n }\r\n\r\n /**\r\n * @api {get} bind(obj,type,callback) 注册事件\r\n * @apiName bind\r\n * @apiGroup Event\r\n * @apiVersion 0.0.1\r\n * @apiDescription 注册鼠标点击事件,支持地图、marker、polyline、polygon的点击事件,包括单击、双击,左键、右键\r\n *\r\n * @apiParam {object} obj 点击的媒介,地图(map)点击、覆盖物(overlay)点击,其他点击\r\n * @apiParam {string} type 支持的监听事件,左键单击(click)、左键双击(dbclick)、右键单击(rightclick)、右键双击(rightdbclick),地图缩放开始(zoomstart)、地图缩放结束(zoomend),拖拽开始(dragstart),拖拽中(dragging),拖拽结束(dragend),地图开始(movestart)、地图移动中(moving)、地图移动结束(moveend),鼠标移动到覆盖物上(mouseover)、离开覆盖物(mouseout)、鼠标在覆盖物上按下(mousedown)、在覆盖物上释放(mouseup)\r\n * @apiParam {function} callback 返回回调函数\r\n *\r\n * @apiExample {bind} 使用示例:\r\n * let event = new KGIS.Event();\r\n * let map = new KGIS.Map();\r\n * event.bind(map,"click",function (e) {\r\n * layer.msg("地图上的坐标是:" + "(" + e.point.lng + ", " + e.point.lat + ")", {icon: 1});\r\n * });\r\n *\r\n */\r\n bind(obj, type, callback) {\r\n let _this = this;\r\n // 内部实名回调方法\r\n let mc = function (e) {\r\n let param = Event.parseE(e);\r\n callback(param);\r\n };\r\n\r\n let mtype = Object.getOwnPropertyNames(obj)[0];\r\n let kmap = mtype;\r\n if (Object.getOwnPropertyNames(obj).length > 1) {\r\n mtype = "map";\r\n kmap = "kmap"\r\n }\r\n\r\n // 第一次添加监听,将类别添加进来\r\n if (!this.event_array.hasOwnProperty(type)) {\r\n this.event_array[type] = [];\r\n }\r\n if (!this.event_array[type][kmap]) {\r\n _this.event_array[type][kmap] = [];\r\n // 判断是否有该类别的监听事件,0个表示需要添加,不用去重\r\n let newObj = {};\r\n obj[mtype].on(type, mc);\r\n newObj[obj[mtype]] = mc;\r\n _this.event_array[type][kmap].push(newObj);\r\n } else {\r\n if (_this.event_array[type][kmap].length === 0) {\r\n _this.event_array[type][kmap] = [];\r\n }\r\n // 该类别中有这个监听,但是绑定的对象是谁,需要循环筛选,对于已经存在的,不在绑定,如果循环结束,还没找到,则添加该监听\r\n this.event_array[type][kmap].forEach(item => {\r\n if (!item.hasOwnProperty(obj[mtype])) {\r\n let newObj = {};\r\n obj[mtype].on(type, function (e) {\r\n callback(e.latLng);\r\n newObj[obj[mtype]] = this;\r\n _this.event_array[type][kmap].push(newObj);\r\n });\r\n\r\n }\r\n });\r\n }\r\n };\r\n\r\n /**\r\n * @api {get} unbind(obj,type,callback) 移除事件\r\n * @apiName unbind\r\n * @apiGroup Event\r\n * @apiVersion 0.0.1\r\n * @apiDescription 移除鼠标点击事件,支持地图、marker、polyline、polygon的点击事件,包括单击、双击,左键、右键\r\n *\r\n * @apiParam {object} obj 点击的媒介,地图(map)点击、覆盖物(overlay)点击,其他点击\r\n * @apiParam {string} type 支持的监听事件,左键单击(click)、左键双击(dbclick)、右键单击(rightclick)、右键双击(rightdbclick),地图缩放开始(zoomstart)、地图缩放结束(zoomend),拖拽开始(dragstart),拖拽中(dragging),拖拽结束(dragend),地图开始(movestart)、地图移动中(moving)、地图移动结束(moveend),鼠标移动到覆盖物上(mouseover)、离开覆盖物(mouseout)、鼠标在覆盖物上按下(mousedown)、在覆盖物上释放(mouseup)\r\n * @apiParam {function} callback 返回回调函数\r\n *\r\n * @apiExample {unbind} 使用示例:\r\n * let event = new KGIS.Event();\r\n * let map = new KGIS.Map();\r\n * event.bind(map,"zoomstart",regMapZoomstartCallback);\r\n * function regMapZoomstartCallback(){\r\n * layer.msg("地图开始缩放", {icon: 1});\r\n * }\r\n *\r\n */\r\n unbind(obj, type, callback) {\r\n let mtype = Object.getOwnPropertyNames(obj)[0];\r\n let kmap = mtype;\r\n if (Object.getOwnPropertyNames(obj).length > 1) {\r\n mtype = "map";\r\n kmap = "kmap";\r\n }\r\n\r\n if (this.event_array[type][kmap]) {\r\n let fun = this.event_array[type][kmap][0][obj[mtype]];\r\n obj[mtype].off(type, fun);\r\n this.event_array[type][kmap].pop();\r\n if (this.event_array[type][kmap].length === 0) {\r\n delete this.event_array[type][kmap]\r\n }\r\n\r\n }\r\n };\r\n\r\n /**\r\n * @api {get} isBind(obj,type,callback) 检测监听事件\r\n * @apiName isBind\r\n * @apiGroup Event\r\n * @apiVersion 0.0.1\r\n * @apiDescription 是否绑定了指定的监听事件,果绑定了就返回true, 没绑定就返回false\r\n *\r\n * @apiParam {object} obj 要检测的对象,地图(map)点击、覆盖物(overlay)点击,其他点击\r\n * @apiParam {string} type 支持的监听事件,左键单击(click)、左键双击(dbclick)、右键单击(rightclick)、右键双击(rightdbclick),地图缩放开始(zoomstart)、地图缩放结束(zoomend),拖拽开始(dragstart),拖拽中(dragging),拖拽结束(dragend),地图开始(movestart)、地图移动中(moving)、地图移动结束(moveend),鼠标移动到覆盖物上(mouseover)、离开覆盖物(mouseout)、鼠标在覆盖物上按下(mousedown)、在覆盖物上释放(mouseup)\r\n * @apiParam {function} callback 绑定的回调函数\r\n *\r\n * @apiExample {isBind} 使用示例:\r\n * let event = new KGIS.Event();\r\n * let map = new KGIS.Map();\r\n * event.bind(map,"zoomstart",regMapZoomstartCallback);\r\n * function regMapZoomstartCallback(){\r\n * layer.msg("地图开始缩放", {icon: 1});\r\n * }\r\n * let flag = event.isBind(map,\'zoomstart\',regMapZoomstartCallback); // flag = true\r\n *\r\n */\r\n isBind(obj, type, callback) {\r\n\r\n let mtype = Object.getOwnPropertyNames(obj)[0];\r\n if (Object.getOwnPropertyNames(obj).length > 1) {\r\n mtype = "kmap";\r\n }\r\n\r\n if (this.event_array[type] === undefined){\r\n return false;\r\n }\r\n return !!this.event_array[type][mtype];\r\n\r\n };\r\n\r\n // 解析回调中的e参数\r\n static parseE(e) {\r\n // TODO 处理不同类型下对e值的封装\r\n // 如果是放大缩小,e = undefined\r\n if (!(e.type === "click" || e.type === "dblclick" || e.type === "rightclick" || e.type === "rightdblclick")) {\r\n return e.type + " is success";\r\n } else {\r\n // 如果是点击地图获取坐标点,e至少含有坐标数据,组织并返回\r\n let result;\r\n let lng, lat;\r\n if (e.target instanceof AMap.Marker) {\r\n lng = e.target.Ch.position.O;\r\n lat = e.target.Ch.position.P;\r\n result = {lng: lng, lat: lat};\r\n } else if (e.target instanceof AMap.Polyline || e.target instanceof AMap.Polygon) {\r\n lng = e.lnglat.O;\r\n lat = e.lnglat.P;\r\n result = {lng: lng, lat: lat, path: e.target.Ch.path};\r\n } else if ((e.type === "click" || e.type === "dblclick" || e.type === "rightclick" || e.type === "rightdblclick")) {\r\n lng = e.lnglat.O;\r\n lat = e.lnglat.P;\r\n result = {lng: lng, lat: lat};\r\n }\r\n return result;\r\n }\r\n }\r\n}\r\n\r\nmodule.exports = Event;\r\n\n\n//# sourceURL=webpack:///./src/map/amap/event.js?')},"./src/map/amap/infowindow.js":function(module,exports,__webpack_require__){eval('const InfoWindowFactory = __webpack_require__(/*! ../../factory/map/infowindow-factory */ "./src/factory/map/infowindow-factory.js");\r\n/**\r\n * @apiDefine HInfoWindow 弹窗类\r\n */\r\nclass InfoWindow extends InfoWindowFactory{\r\n /*\r\n * @api {get} constructor() 构造函数\r\n * @apiName constructor\r\n * @apiGroup HInfoWindow\r\n * @apiVersion 0.0.1\r\n * @apiDescription 构造函数\r\n *\r\n */\r\n constructor() {\r\n super();\r\n this.infoWindow = "";\r\n }\r\n\r\n /**\r\n * @api {get} openInfoWindow(infoWindow,e) 打开信息窗体\r\n * @apiName openInfoWindow\r\n * @apiGroup HInfoWindow\r\n * @apiVersion 0.0.1\r\n * @apiDescription 打开信息窗体\r\n *\r\n * @apiParam {object} infoWindow 弹窗实例对象\r\n * @apiParam {object} point 当前点击的坐标点,一般通过e获取\r\n *\r\n * @apiExample {openInfoWindow} 使用示例:\r\n * // point 是当前点击的位置,通过marker或者其他回调监听到的e获取\r\n * let infoWindow = new KGIS.InfoWindow();\r\n * let options = {\r\n * width: 200,\r\n * height:100,\r\n * title:"我是标题"\r\n * }\r\n * let iWindow = infoWindow.newInfoWindow("我是要显示的内容,也可以是html布局文件", options);\r\n * infoWindow.openInfoWindow(iWindow, point);\r\n *\r\n */\r\n openInfoWindow(infoWindow, lngLat) {\r\n let point = new KGIS.Point(lngLat.lng, lngLat.lat);\r\n infoWindow.open(KGIS.map, point);\r\n };\r\n\r\n /*\r\n * @api {get} size(width,height) 新建Size尺寸\r\n * @apiName size\r\n * @apiGroup HInfoWindow\r\n * @apiVersion 0.0.1\r\n * @apiDescription 新建Size尺寸\r\n *\r\n * @apiParam {number} width 传入宽度.\r\n * @apiParam {number} height 传入高度.\r\n *\r\n * @apiExample {size} 使用示例:\r\n * let infoWindow = new KGIS.InfoWindow();\r\n * let s = infoWindow.size(36,36)\r\n *\r\n * @apiSuccessExample 响应成功:\r\n * HTTP/1.1 200 OK\r\n * Size对象\r\n */\r\n size(width, height) {\r\n return new AMap.Size(width, height);\r\n }\r\n\r\n}\r\n\r\nmodule.exports = InfoWindow;\r\n\n\n//# sourceURL=webpack:///./src/map/amap/infowindow.js?')},"./src/map/amap/layer.js":function(module,exports,__webpack_require__){eval('const LayerFactory = __webpack_require__(/*! ../../factory/map/layer-factory */ "./src/factory/map/layer-factory.js");\r\n/**\r\n * @apiDefine JLayer 图层类\r\n */\r\nclass Layer extends LayerFactory{\r\n /*\r\n * @api {get} constructor() 构造函数\r\n * @apiName constructor\r\n * @apiGroup JLayer\r\n * @apiVersion 0.0.1\r\n * @apiDescription 构造函数,去除父级的原型参数\r\n *\r\n */\r\n constructor() {\r\n super();\r\n }\r\n\r\n}\r\n\r\nmodule.exports = Layer;\r\n\n\n//# sourceURL=webpack:///./src/map/amap/layer.js?')},"./src/map/amap/location.js":function(module,exports,__webpack_require__){eval('const Common = __webpack_require__(/*! ./../../util/common */ "./src/util/common.js");\r\nconst LocationFactory = __webpack_require__(/*! ../../factory/map/location-factory */ "./src/factory/map/location-factory.js");\r\n/**\r\n * @apiDefine ELocation 定位类\r\n */\r\nclass Location extends LocationFactory{\r\n /*\r\n * @api {get} constructor() 构造函数\r\n * @apiName constructor\r\n * @apiGroup ELocation\r\n * @apiVersion 0.0.1\r\n *\r\n */\r\n constructor() {\r\n super();\r\n }\r\n\r\n /**\r\n * @api {get} locationByLnglat(...lnglat) 根据经纬度定位\r\n * @apiName locationByLnglat\r\n * @apiGroup ELocation\r\n * @apiVersion 0.0.1\r\n * @apiDescription 根据经纬度定位。\r\n *\r\n * @apiParam {number/array} params 传入的经纬度参数(可以使数组[120,36],也可以是两个数值参数120,36,接口会根据传参类型自动适配)\r\n *\r\n * @apiExample {locationByLnglat} 使用示例:\r\n * let location = new KGIS.Location();\r\n * location.locationByLnglat(120, 36);\r\n * location.locationByLnglat([120, 36]);\r\n *\r\n */\r\n locationByLnglat(...latlng) {\r\n this.getLocation(...latlng);\r\n };\r\n\r\n /**\r\n * @api {get} locationByPoint(...point) 根据Point定位\r\n * @apiName locationByPoint\r\n * @apiGroup ELocation\r\n * @apiVersion 0.0.1\r\n * @apiDescription 根据Point定位\r\n *\r\n * @apiParam {object} point 传入的point对象,可以通过let map = new KGIS.Map(); map.newPoint(120,36)生成\r\n *\r\n * @apiExample {locationByPoint} 使用示例:\r\n * let location = new KGIS.Location();\r\n * let map = new KGIS.Map();\r\n * let point = map.newPoint(120, 36);\r\n * location.locationByPoint(point);\r\n *\r\n */\r\n locationByPoint(...point) {\r\n this.getLocation(...point);\r\n }\r\n\r\n getLocation(...param){\r\n let map = KGIS.map;\r\n const [x, y] = param;\r\n\r\n if (Common.getType(x) === "number") {\r\n const point = new AMap.LngLat(x, y);\r\n map.panTo(point);\r\n } else if (Common.getType(x) === "array") {\r\n // 参数是 [lng, lat]\r\n const point = new AMap.LngLat(x[0], x[1]);\r\n map.panTo(point);\r\n } else if (Common.getType(x) === "object") {\r\n // 参数是 point = new AMap.LngLat(117,36)\r\n map.panTo(x);\r\n }\r\n map.setZoom(15);\r\n }\r\n\r\n}\r\n\r\nmodule.exports = Location;\r\n\n\n//# sourceURL=webpack:///./src/map/amap/location.js?')},"./src/map/amap/map.js":function(module,exports,__webpack_require__){eval('const Common = __webpack_require__(/*! ./../../util/common */ "./src/util/common.js");\r\nconst MapFactory = __webpack_require__(/*! ../../factory/map/map-factory */ "./src/factory/map/map-factory.js");\r\n/**\r\n * @apiDefine CMap 地图类\r\n */\r\nclass MapModule extends MapFactory{\r\n /*\r\n * @api {get} constructor() 构造函数\r\n * @apiName constructor\r\n * @apiGroup CMap\r\n * @apiVersion 0.0.1\r\n *\r\n * @apiParam {object} map 定义的属性map.\r\n */\r\n constructor() {\r\n super();\r\n this.map = KGIS.map;\r\n }\r\n\r\n /**\r\n * @api {get} getMap() 获取原生地图对象\r\n * @apiName getMap\r\n * @apiGroup CMap\r\n * @apiVersion 0.0.1\r\n * @apiDescription 获取实例化的地图对象,即div中经过 new TMap.Map(id)实例化的对象\r\n *\r\n * @apiExample {getMap} 使用示例:\r\n * let map = new KGIS.Map();\r\n * let origin_map = map.getMap();\r\n *\r\n * @apiSuccessExample 响应成功:\r\n * HTTP/1.1 200 OK\r\n * 实例化的Map对象\r\n */\r\n getMap() {\r\n return this.map;\r\n };\r\n\r\n /**\r\n * @api {get} setMapType(type) 设置地图类型\r\n * @apiName setMapType\r\n * @apiGroup CMap\r\n * @apiVersion 0.0.1\r\n * @apiDescription 设置地图类型\r\n *\r\n * @apiExample {setMapType} 使用示例:\r\n * let map = new KGIS.Map();\r\n * map.setMapType("normal"); // 初始化地图类型为普通地图,显示普通和混合地图类型\r\n * map.setMapType("hybird"); // 初始化地图类型为普通地图,显示普通和混合地图类型\r\n * 1.normal-正常地图\r\n * 2.hybird-卫星影像图(带路网)\r\n *\r\n */\r\n setMapType(type) {\r\n const _this = this;\r\n let mapType = 0;\r\n if (type === "normal") {\r\n mapType = 0;\r\n } else if (type === "hybird") {\r\n mapType = 1;\r\n }\r\n this.map.plugin(["AMap.MapType"], function () {\r\n //地图类型切换\r\n const type = new AMap.MapType({\r\n defaultType: mapType //使用2D地图\r\n });\r\n _this.map.addControl(type);\r\n });\r\n };\r\n\r\n /**\r\n * @api {get} zoomIn() 缩放-放大\r\n * @apiName zoomIn\r\n * @apiGroup CMap\r\n * @apiVersion 0.0.1\r\n * @apiDescription 放大一级视图\r\n *\r\n * @apiExample {zoomIn} 使用示例:\r\n * let map = new KGIS.Map();\r\n * map.zoomIn();\r\n *\r\n */\r\n zoomIn() {\r\n this.map.zoomIn();\r\n };\r\n\r\n /**\r\n * @api {get} zoomOut() 缩放-缩小\r\n * @apiName zoomOut\r\n * @apiGroup CMap\r\n * @apiVersion 0.0.1\r\n * @apiDescription 缩小一级视图\r\n *\r\n * @apiExample {zoomOut} 使用示例:\r\n * let map = new KGIS.Map();\r\n * map.zoomOut();\r\n *\r\n */\r\n zoomOut() {\r\n this.map.zoomOut();\r\n };\r\n\r\n /**\r\n * @api {get} enableDoubleClickZoom() 双击放大-开启\r\n * @apiName enableDoubleClickZoom\r\n * @apiGroup CMap\r\n * @apiVersion 0.0.1\r\n * @apiDescription 双击鼠标左键放大一级视图\r\n *\r\n * @apiExample {enableDoubleClickZoom} 使用示例:\r\n * let map = new KGIS.Map();\r\n * map.enableDoubleClickZoom();\r\n *\r\n */\r\n enableDoubleClickZoom() {\r\n this.map.setStatus({doubleClickZoom: true});\r\n };\r\n\r\n /**\r\n * @api {get} disableDoubleClickZoom() 双击放大-禁用\r\n * @apiName disableDoubleClickZoom\r\n * @apiGroup CMap\r\n * @apiVersion 0.0.1\r\n * @apiDescription 禁用双击鼠标左键放大一级视图\r\n *\r\n * @apiExample {disableDoubleClickZoom} 使用示例:\r\n * let map = new KGIS.Map();\r\n * map.disableDoubleClickZoom();\r\n *\r\n */\r\n disableDoubleClickZoom() {\r\n this.map.setStatus({doubleClickZoom: false});\r\n };\r\n\r\n /**\r\n * @api {get} centerAndZoom(point/cityName) 居中缩放\r\n * @apiName centerAndZoom\r\n * @apiGroup CMap\r\n * @apiVersion 0.0.1\r\n * @apiDescription 根据城市名/Point进行定位,并缩放到目标层级,参数为动态的。\r\n *\r\n * @apiParam {params} params params解构出 position和level,其中position可以是string(城市名称)、数组(经纬度)和Point对象,接口会根据传入参数的类型自动适配\r\n *\r\n * @apiExample {centerAndZoom} 使用示例:\r\n * let map = new KGIS.Map();\r\n * map.centerAndZoom("济南", 11); // 方法1\r\n * map.centerAndZoom([120, 36], 11); // 方法2\r\n * map.centerAndZoom(map.newPoint(120, 36), 11); // 方法3\r\n *\r\n */\r\n centerAndZoom(...params) {\r\n const [position, level] = params;\r\n\r\n // 第一个参数是 city\r\n if (Common.getType(position) === "string") {\r\n this.centerAndZoomByCity(position, level);\r\n } else if (Common.getType(position) === "array") {\r\n // 第一个参数是 [lng, lat]\r\n this.centerAndZoomByPoint(position, level);\r\n } else if (Common.getType(position) === "object") {\r\n // 第一个参数是 point\r\n const lnglat = [position.lng, position.lat];\r\n this.centerAndZoomByPoint(lnglat, level);\r\n }\r\n };\r\n\r\n /*\r\n * @api {get} centerAndZoomByCity(city,level) 根据城市名定位\r\n * @apiName centerAndZoomByCity\r\n * @apiGroup CMap\r\n * @apiVersion 0.0.1\r\n * @apiDescription 根据城市名定位,并缩放到目标层级。\r\n *\r\n * @apiParam {string} city 传入城市名称.\r\n * @apiParam {number} level 传入缩放层级.\r\n *\r\n * @apiExample {centerAndZoomByCity} 使用示例:\r\n * let map = new KGIS.Map();\r\n * map.centerAndZoomByCity(“济南”, 11);\r\n *\r\n */\r\n centerAndZoomByCity(city, level) {\r\n this.map.setCity(city); // 高德要求:菏泽市,而百度要求:菏泽\r\n this.map.setZoom(level);\r\n };\r\n\r\n /*\r\n * @api {get} centerAndZoomByPoint(city,level) 根据点位名定位\r\n * @apiName centerAndZoomByPoint\r\n * @apiGroup CMap\r\n * @apiVersion 0.0.1\r\n * @apiDescription 根据点位定位,并缩放到目标层级。\r\n *\r\n * @apiParam {point} point 传入Point对象.\r\n * @apiParam {number} level 传入缩放层级.\r\n *\r\n * @apiExample {centerAndZoomByPoint} 使用示例:\r\n * let map = new KGIS.Map();\r\n * map.centerAndZoomByPoint([120, 36], 11);\r\n *\r\n */\r\n centerAndZoomByPoint(point, level) {\r\n this.map.setZoomAndCenter(level, point);\r\n };\r\n\r\n /**\r\n * @api {get} panTo(...position) 移动到点的位置\r\n * @apiName panTo\r\n * @apiGroup CMap\r\n * @apiVersion 0.0.1\r\n * @apiDescription 根据传入的点的坐标,移动到该处。\r\n *\r\n * @apiParam {array/object} position 参数可以是数组和LngLat对象,接口根据传入参数自动适配。\r\n *\r\n * @apiExample {panTo} 使用示例:\r\n * let map = new KGIS.Map();\r\n * map.panTo(120, 36); // 方法1\r\n * map.panTo([120, 36]); // 方法2\r\n * map.panTo(map.newPoint(120, 36)); // 方法3\r\n *\r\n */\r\n panTo(...position) {\r\n const [x, y] = position;\r\n\r\n if (Common.getType(x) === "number") {\r\n const point = new AMap.LngLat(x, y);\r\n this.map.panTo(point);\r\n } else if (Common.getType(x) === "array") {\r\n // 参数是 [lng, lat]\r\n const point = new AMap.LngLat(x[0], x[1]);\r\n this.map.panTo(point);\r\n } else if (Common.getType(x) === "object") {\r\n // 参数是 point = new AMap.LngLat(117,36)\r\n this.map.panTo(x);\r\n }\r\n };\r\n\r\n /*\r\n * @api {get} setDrag(flag) 设置是否可以拖动\r\n * @apiName setDrag\r\n * @apiGroup CMap\r\n * @apiVersion 0.0.1\r\n * @apiDescription 设置是否可以拖动,true表示可以拖动,反之不能拖动。\r\n *\r\n * @apiParam {boolean} flag 设置为true表示可以拖动,反之不能拖动\r\n *\r\n * @apiExample {setDrag} 使用示例:\r\n * let map = new KGIS.Map();\r\n * map.setDrag(false);\r\n *\r\n */\r\n setDrag(flag) {\r\n this.map.setStatus({dragEnable: flag});\r\n }\r\n\r\n}\r\n\r\nmodule.exports = MapModule;\r\n\n\n//# sourceURL=webpack:///./src/map/amap/map.js?')},"./src/map/amap/measure.js":function(module,exports,__webpack_require__){eval('const MeasureFactory = __webpack_require__(/*! ../../factory/map/measure-factory */ "./src/factory/map/measure-factory.js");\r\n/**\r\n * @apiDefine IMeasure 测量类\r\n */\r\nclass Measure extends MeasureFactory{\r\n\r\n /*\r\n * @api {get} constructor() 构造函数\r\n * @apiName constructor\r\n * @apiGroup IMeasure\r\n * @apiVersion 0.0.1\r\n * @apiDescription 构造函数,去除父级的原型参数\r\n *\r\n */\r\n constructor() {\r\n super();\r\n }\r\n\r\n /**\r\n * @api {get} newMeasureLine() 新建线段测量对象\r\n * @apiName newMeasureLine\r\n * @apiGroup IMeasure\r\n * @apiVersion 0.0.1\r\n * @apiDescription 新建线段测量对象\r\n *\r\n * @apiExample {measureLine} 使用示例:\r\n * let measure = new KGIS.Measure();\r\n * let measureLine = measure.newMeasureLine();\r\n *\r\n * @apiSuccessExample 响应成功:\r\n * HTTP/1.1 200 OK\r\n * MeasureLine对象\r\n *\r\n */\r\n newMeasureLine() {\r\n let map = KGIS.map;\r\n let rangingTool = new AMap.RangingTool(map);\r\n this.measureLine = rangingTool;\r\n AMap.event.addListener(rangingTool, "end", e => {\r\n rangingTool.turnOff();\r\n });\r\n return rangingTool;\r\n };\r\n\r\n /**\r\n * @api {get} openMeasureLine(measureLine) 开始测量线段长度\r\n * @apiName openMeasureLine\r\n * @apiGroup IMeasure\r\n * @apiVersion 0.0.1\r\n * @apiDescription 开始测量线段长度,双击结束\r\n *\r\n * @apiParam {object} measureLine 实例化的测量对象\r\n *\r\n * @apiExample {openMeasureLine} 使用示例:\r\n * let measure = new KGIS.Measure();\r\n * let measureLine = measure.newMeasureLine();\r\n * measure.openMeasureLine(measureLine);\r\n *\r\n */\r\n openMeasureLine(measureLine) {\r\n measureLine.turnOn();\r\n };\r\n\r\n /**\r\n * @api {get} closeMeasureLine(measureLine) 结束测量线段长度\r\n * @apiName closeMeasureLine\r\n * @apiGroup IMeasure\r\n * @apiVersion 0.0.1\r\n * @apiDescription 结束测量线段长度\r\n *\r\n * @apiParam {object} measureLine 实例化的测量对象\r\n *\r\n * @apiExample {closeMeasureLine} 使用示例:\r\n * let measure = new KGIS.Measure();\r\n * measure.closeMeasureLine(measureLine);\r\n *\r\n */\r\n closeMeasureLine(measureLine) {\r\n measureLine.turnOff();\r\n };\r\n\r\n /**\r\n * @api {get} newMeasureArea() 新建面积测量对象\r\n * @apiName newMeasureArea\r\n * @apiGroup IMeasure\r\n * @apiVersion 0.0.1\r\n * @apiDescription 新建面积测量对象\r\n *\r\n * @apiExample {newMeasureArea} 使用示例:\r\n * let measure = new KGIS.Measure();\r\n * measure.newMeasureArea();\r\n *\r\n * @apiSuccessExample 响应成功:\r\n * HTTP/1.1 200 OK\r\n * MeasureArea对象\r\n *\r\n */\r\n newMeasureArea() {\r\n const map = KGIS.map;\r\n let mouseTool = new AMap.MouseTool(map);\r\n this.measureArea = mouseTool;\r\n AMap.event.addListener(mouseTool, "draw", e => {\r\n this.measureArea.close();\r\n });\r\n return mouseTool;\r\n };\r\n\r\n /**\r\n * @api {get} openMeasureArea(measureArea) 开始测量面积\r\n * @apiName openMeasureArea\r\n * @apiGroup IMeasure\r\n * @apiVersion 0.0.1\r\n * @apiDescription 开始测量面积,双击结束\r\n *\r\n * @apiParam {object} measureArea 实例化的测量对象\r\n *\r\n * @apiExample {openMeasureArea} 使用示例:\r\n * let measure = new KGIS.Measure();\r\n * let measureArea = measure.newMeasureArea();\r\n * measure.openMeasureArea(measureArea);\r\n *\r\n */\r\n openMeasureArea(measureArea) {\r\n measureArea.measureArea();\r\n };\r\n\r\n /**\r\n * @api {get} closeMeasureArea(measureArea) 结束测量面积\r\n * @apiName closeMeasureArea\r\n * @apiGroup IMeasure\r\n * @apiVersion 0.0.1\r\n * @apiDescription 结束测量面积\r\n *\r\n * @apiParam {object} measureArea 实例化的测量对象\r\n *\r\n * @apiExample {closeMeasureArea} 使用示例:\r\n * let measure = new KGIS.Measure();\r\n * measure.closeMeasureArea(measureArea);\r\n *\r\n */\r\n closeMeasureArea(measureArea) {\r\n measureArea.close();\r\n }\r\n\r\n}\r\n\r\nmodule.exports = Measure;\r\n\n\n//# sourceURL=webpack:///./src/map/amap/measure.js?')},"./src/map/amap/menu.js":function(module,exports,__webpack_require__){eval('const MenuFactory = __webpack_require__(/*! ../../factory/map/menu-factory */ "./src/factory/map/menu-factory.js");\r\n/**\r\n * @apiDefine GMenu 菜单类\r\n */\r\nclass Menu extends MenuFactory{\r\n /*\r\n * @api {get} constructor() 构造函数\r\n * @apiName constructor\r\n * @apiGroup GMenu\r\n * @apiVersion 0.0.1\r\n * @apiDescription 构造函数,去除父级的原型参数\r\n *\r\n */\r\n constructor() {\r\n super();\r\n }\r\n\r\n /*\r\n * @api {get} menu() 菜单\r\n * @apiName menu\r\n * @apiGroup GMenu\r\n * @apiVersion 0.0.1\r\n * @apiDescription 菜单\r\n *\r\n * @apiExample {menu} 使用示例:\r\n * let menu = new KGIS.Menu();\r\n * let mapmenu = menu.getMapMenu();\r\n *\r\n */\r\n menu() {\r\n }\r\n\r\n}\r\n\r\nmodule.exports = Menu;\r\n\n\n//# sourceURL=webpack:///./src/map/amap/menu.js?')},"./src/map/amap/obj/icon.js":function(module,exports,__webpack_require__){eval("let Overlay = __webpack_require__(/*! ./../overlay */ \"./src/map/amap/overlay.js\");\r\nlet ol = new Overlay();\r\n/**\r\n * @apiDefine FOverlay 标注类\r\n */\r\nclass Icon{\r\n /*\r\n * @api {get} constructor() 构造函数\r\n * @apiName constructor\r\n * @apiGroup FOverlay\r\n * @apiVersion 0.0.1\r\n * @apiDescription 构造函数,去除父级的原型参数\r\n *\r\n */\r\n constructor(iconOptions) {\r\n\r\n /**\r\n * @api {get} Icon(iconOptions) 新建图标\r\n * @apiName Icon\r\n * @apiGroup FOverlay\r\n * @apiVersion 0.0.1\r\n * @apiDescription 新建标注点:iconOptions现在支持url、size、imageOffset\r\n *\r\n * @apiParam {object} iconOptions 传入icon配置参数,现在支持url、size、imageOffset\r\n *\r\n * @apiExample {Icon} 使用示例:\r\n * let overlay = new KGIS.Overlay();\r\n * let iconOptions = {\r\n * url:'./img/marker.png',\r\n * size:overlay.size(36,36), // 默认是36\r\n * imageOffset:overlay.size(5,5) // 图片相对于可视域的偏移值\r\n * };\r\n * let icon = new KGIS.Icon(iconOptions);\r\n *\r\n * @apiSuccessExample 响应成功:\r\n * HTTP/1.1 200 OK\r\n * Icon对象\r\n */\r\n let url = iconOptions.url;\r\n delete iconOptions['url'];\r\n iconOptions[\"image\"] = url;\r\n let icon = new AMap.Icon(iconOptions);\r\n icon.map = KGIS.map;\r\n this.icon = ol.icon = icon;\r\n return icon;\r\n }\r\n}\r\n\r\nmodule.exports = Icon;\r\n\n\n//# sourceURL=webpack:///./src/map/amap/obj/icon.js?")},"./src/map/amap/obj/infowindow.js":function(module,exports,__webpack_require__){eval('let InfoWindowModule = __webpack_require__(/*! ./../infowindow */ "./src/map/amap/infowindow.js");\r\nlet iWindowModule = new InfoWindowModule();\r\n\r\n/**\r\n * @apiDefine HInfoWindow 弹窗类\r\n */\r\nclass InfoWindow extends InfoWindowModule {\r\n /*\r\n * @api {} constructor() 构造函数\r\n * @apiName constructor\r\n * @apiGroup HInfoWindow\r\n * @apiVersion 0.0.1\r\n *\r\n */\r\n constructor(content, options) {\r\n super();\r\n /**\r\n * @api {get} InfoWindow(content,opt