api.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713
  1. import forOwn from 'lodash/forOwn';
  2. import isEqual from 'lodash/isEqual';
  3. import isNil from 'lodash/isNil';
  4. import isEmpty from 'lodash/isEmpty';
  5. //import loadjscssfile from './loadScript';
  6. import APILoader from './APILoader'
  7. const xdebug = console.log;
  8. // const xdebug = () => {};
  9. export const loadApi = (key = '0325e3d6d69cd56de4980b4f28906fd8') => {
  10. return new APILoader({
  11. key,
  12. useAMapUI: true,
  13. version: '1.4.7',
  14. protocol: 'https'
  15. }).load();
  16. };
  17. export const loadMap = key => {
  18. return new Promise((resolve, reject) => {
  19. if (window.AMap) {
  20. resolve(window.AMap);
  21. }
  22. loadApi(key)
  23. .then(ret => {
  24. if (window.AMap) {
  25. resolve(window.AMap);
  26. } else {
  27. reject(new Error('window.AMap不存在!'));
  28. }
  29. })
  30. .catch(error => {
  31. reject(new Error('加载地图错误!' + error.message));
  32. });
  33. });
  34. };
  35. // export const loadApiV1 = async (key = '0325e3d6d69cd56de4980b4f28906fd8') => {
  36. // return await loadjscssfile(
  37. // 'https://webapi.amap.com/maps?v=1.4.7&key=' + key,
  38. // 'js'
  39. // );
  40. // };
  41. // export const loadMapV1 = key => {
  42. // return new Promise((resolve, reject) => {
  43. // if (window.AMap) {
  44. // resolve(window.AMap);
  45. // }
  46. // loadApi(key)
  47. // .then(ret => {
  48. // if (window.AMap) {
  49. // resolve(window.AMap);
  50. // } else {
  51. // reject(new Error('window.AMap不存在!'));
  52. // }
  53. // })
  54. // .catch(error => {
  55. // reject(new Error('加载地图错误!' + error.message));
  56. // });
  57. // });
  58. // };
  59. /**
  60. * [加载插件](https://lbs.amap.com/api/javascript-api/guide/abc/plugins)
  61. * 加载完成后,可以调用:
  62. * var toolbar = new window.AMap.ToolBar();
  63. * map.addControl(toolbar);
  64. * @param {string} name 插件名或插件数组,如:window.AMap.ToolBar,['AMap.ToolBar','AMap.Driving']
  65. */
  66. export const loadPlugin = name => {
  67. return new Promise((resolve, reject) => {
  68. if (window.AMap) {
  69. window.AMap.plugin(name, () => {
  70. resolve(true);
  71. });
  72. //是否有加载失败的情况,如果加载失败,怎么reject?
  73. } else {
  74. reject(new Error('地图还未加载!'));
  75. }
  76. });
  77. };
  78. ////////////////////////////////////////////////////////////
  79. // 工具方法
  80. ////////////////////////////////////////////////////////////
  81. const commonUpdate = (
  82. entity,
  83. newOptions,
  84. newEvents,
  85. oldOptions,
  86. oldEvents,
  87. operators,
  88. __func__ = 'commonUpdate'
  89. ) => {
  90. // const __func__ = 'commonUpdate';
  91. if (!entity) {
  92. xdebug(__func__, 'fail! no entity!');
  93. return false;
  94. }
  95. // 找到改变的属性集合,包含添加,删除及修改的属性,删除的置为null
  96. let props = {};
  97. if (newOptions != oldOptions) {
  98. oldOptions &&
  99. forOwn(oldOptions, (value, key) => {
  100. // 找到改变的旧属性,用新属性取代
  101. let newValue = newOptions && newOptions[key];
  102. if (!isEqual(newValue, value)) {
  103. if (!(isNil(newValue) && isNil(value)))
  104. props[key] = newValue;
  105. }
  106. });
  107. newOptions &&
  108. forOwn(newOptions, (value, key) => {
  109. // 找到新加的属性,添加进去
  110. let oldValue = oldOptions && oldOptions[key];
  111. if (isNil(oldValue) && !isNil(value)) {
  112. props[key] = value;
  113. }
  114. });
  115. }
  116. // 找到改变的事件集合,包含添加,删除及修改的事件处理函数,删除的置为null
  117. let events = {};
  118. if (newEvents != oldEvents) {
  119. oldEvents &&
  120. forOwn(oldEvents, (value, key) => {
  121. // 找到改变的旧属性,用新属性取代
  122. let newValue = newEvents && newEvents[key];
  123. if (!isEqual(newValue, value)) {
  124. if (!(isNil(newValue) && isNil(value)))
  125. events[key] = newValue;
  126. }
  127. });
  128. newEvents &&
  129. forOwn(newEvents, (value, key) => {
  130. // 找到新加的属性,添加进去
  131. let oldValue = oldEvents && oldEvents[key];
  132. if (isNil(oldValue) && !isNil(value)) {
  133. events[key] = value;
  134. }
  135. });
  136. }
  137. // let operators = {
  138. // map: v => entity.setMap(v),
  139. // position: v => entity.setPosition(v),
  140. // offset: v => entity.setOffset(v),
  141. // icon: v => entity.setIcon(v),
  142. // content: v => entity.setContent(v),
  143. // topWhenClick: null,
  144. // bubble: null,
  145. // draggable: v => entity.setDraggable(v),
  146. // raiseOnDrag: null,
  147. // cursor: v => entity.setCursor(v),
  148. // visible: null,
  149. // zIndex: v => entity.setzIndex(v),
  150. // angle: v => entity.setAngle(v),
  151. // autoRotation: null,
  152. // animation: v => entity.setAnimation(v),
  153. // shadow: v => entity.setShadow(v),
  154. // title: v => entity.setTitle(v),
  155. // clickable: v => entity.setClickable(v),
  156. // shape: v => entity.setShape(v),
  157. // extData: v => entity.setExtData(v),
  158. // label: v => entity.setLabel(v)
  159. // };
  160. forOwn(props, (value, key) => {
  161. if (value) {
  162. let func = operators[key];
  163. if (func) {
  164. func(value);
  165. } else {
  166. // ignore properties can not set.
  167. xdebug(__func__, 'warning! no setter! can not update ' + key);
  168. }
  169. } else {
  170. // key removed, not support!
  171. xdebug(__func__, 'warning! remove prop not support! key=' + key);
  172. }
  173. });
  174. forOwn(events, (value, key) => {
  175. let oldFunc = oldEvents && oldEvents[key];
  176. if (oldFunc) {
  177. entity.off(key, oldFunc);
  178. }
  179. if (value) {
  180. entity.on(key, value);
  181. }
  182. });
  183. if (!isEmpty(props) || !isEmpty(events)) {
  184. xdebug(
  185. __func__, 'update:',
  186. entity,
  187. props,
  188. events,
  189. // newOptions,
  190. // newEvents,
  191. // oldOptions,
  192. // oldEvents
  193. );
  194. }
  195. return true;
  196. };
  197. ////////////////////////////////////////////////////////////
  198. // Map
  199. ////////////////////////////////////////////////////////////
  200. export const createMap = (dom, options, events) => {
  201. const __func__ = 'createMap';
  202. if (!window.AMap) {
  203. xdebug(__func__, 'fail! no window.AMap!');
  204. return null;
  205. }
  206. if (!dom) {
  207. xdebug(__func__, 'fail! no dom!');
  208. return null;
  209. }
  210. let map = new window.AMap.Map(dom, { ...(options || {}) });
  211. forOwn(events, (value, key) => {
  212. xdebug(__func__, 'event on ' + key);
  213. map.on(key, value);
  214. });
  215. xdebug(__func__, 'ok!');
  216. return map;
  217. };
  218. export const updateMap = (
  219. map,
  220. newOptions,
  221. newEvents,
  222. oldOptions,
  223. oldEvents
  224. ) => {
  225. let operators = {
  226. view: null,
  227. layers: v => map.setLayers(v),
  228. zoom: v => map.setZoom(v),
  229. center: v => map.setCenter(v),
  230. labelzIndex: v => map.setlabelzIndex(v),
  231. zooms: null,
  232. lang: v => map.setLang(v),
  233. defaultCursor: v => map.setDefaultCursor(v),
  234. crs: null,
  235. animateEnable: null,
  236. isHotspot: v => map.setStatus({ isHotspot: v }),
  237. defaultLayer: v => map.setDefaultLayer(v),
  238. rotateEnable: null,
  239. resizeEnable: null,
  240. showIndoorMap: null,
  241. indoorMap: null,
  242. expandZoomRange: null,
  243. dragEnable: v => map.setStatus({ dragEnable: v }),
  244. zoomEnable: null,
  245. doubleClickZoom: v => map.setStatus({ doubleClickZoom: v }),
  246. keyboardEnable: v => map.setStatus({ keyboardEnable: v }),
  247. jogEnable: null,
  248. scrollWheel: null,
  249. touchZoom: null,
  250. touchZoomCenter: null,
  251. mapStyle: v => map.setMapStyle(v),
  252. features: v => map.setFeatures(v),
  253. showBuildingBlock: null,
  254. viewMode: null,
  255. pitch: v => map.setPitch(v),
  256. pitchEnable: null,
  257. buildAnimation: null,
  258. skyColor: null,
  259. preloadMode: null
  260. };
  261. return commonUpdate (
  262. map,
  263. newOptions,
  264. newEvents,
  265. oldOptions,
  266. oldEvents,
  267. operators,
  268. 'updateMap'
  269. )
  270. };
  271. ////////////////////////////////////////////////////////////
  272. // Marker
  273. ////////////////////////////////////////////////////////////
  274. /**
  275. *
  276. * @param {*} AMap
  277. * @param {*} map
  278. * @param {*} options 如果有dom用来显示,则其中的content字段即被填充为dom,不再用独立参数表示dom
  279. * @param {*} events
  280. */
  281. export const createMarker = (options, events) => {
  282. const __func__ = 'createMarker';
  283. if (!window.AMap) {
  284. xdebug(__func__, 'fail! no window.AMap!');
  285. return null;
  286. }
  287. if (!options) {
  288. xdebug(__func__, 'fail! no options!');
  289. return null;
  290. }
  291. if (!options.map) {
  292. xdebug(__func__, 'fail! no options.map!');
  293. return null;
  294. }
  295. // let marker = new AMap.Marker({
  296. // icon: "https://webapi.amap.com/theme/v1.3/markers/n/mark_b.png",
  297. // position: [116.405467, 39.907761]
  298. // });
  299. // marker.setMap(map);
  300. let entity = new window.AMap.Marker(options);
  301. forOwn(events, (value, key) => {
  302. entity.on(key, value);
  303. });
  304. xdebug(__func__, 'ok!');
  305. return entity;
  306. };
  307. export const updateMarker = (
  308. entity,
  309. newOptions,
  310. newEvents,
  311. oldOptions,
  312. oldEvents
  313. ) => {
  314. let operators = {
  315. map: v => entity.setMap(v),
  316. position: v => entity.setPosition(v),
  317. offset: v => entity.setOffset(v),
  318. icon: v => { setTimeout(()=> entity.setIcon(v),0); }, // 这里有一个bug,在某些时候页面更改icon时,界面上并不生效.
  319. content: v => entity.setContent(v),
  320. topWhenClick: null,
  321. bubble: null,
  322. draggable: v => entity.setDraggable(v),
  323. raiseOnDrag: null,
  324. cursor: v => entity.setCursor(v),
  325. visible: null,
  326. zIndex: v => entity.setzIndex(v),
  327. angle: v => entity.setAngle(v),
  328. autoRotation: null,
  329. animation: v => entity.setAnimation(v),
  330. shadow: v => entity.setShadow(v),
  331. title: v => entity.setTitle(v),
  332. clickable: v => entity.setClickable(v),
  333. shape: v => entity.setShape(v),
  334. extData: v => entity.setExtData(v),
  335. label: v => entity.setLabel(v)
  336. };
  337. return commonUpdate (
  338. entity,
  339. newOptions,
  340. newEvents,
  341. oldOptions,
  342. oldEvents,
  343. operators,
  344. 'updateMarker'
  345. )
  346. };
  347. ////////////////////////////////////////////////////////////
  348. // Traffic layer, warning! is a layer!
  349. ////////////////////////////////////////////////////////////
  350. /**
  351. *
  352. * @param {*} AMap
  353. * @param {*} map
  354. * @param {*} options 如果有dom用来显示,则其中的content字段即被填充为dom,不再用独立参数表示dom
  355. * @param {*} events
  356. */
  357. export const createTraffic = (options, events) => {
  358. const __func__ = 'createTraffic';
  359. if (!window.AMap || !options || !options.map) {
  360. xdebug(__func__, 'fail! parameters!', 'window.AMap:'+!!window.AMap, 'options:'+!!options, 'options.map:'+!!(options&&options.map));
  361. return null;
  362. }
  363. let {map, ...restOpts} = options;
  364. let entity = new window.AMap.TileLayer.Traffic(restOpts);
  365. forOwn(events, (value, key) => {
  366. entity.on(key, value);
  367. });
  368. entity.setMap(map);
  369. xdebug(__func__, 'ok!');
  370. return entity;
  371. };
  372. export const updateTraffic = (
  373. entity,
  374. newOptions,
  375. newEvents,
  376. oldOptions,
  377. oldEvents
  378. ) => {
  379. let operators = {
  380. map: v => entity.setMap(v),
  381. zIndex: v => entity.setzIndex(v),
  382. opacity: v => entity.setOpacity(v),
  383. zooms: null,
  384. detectRetina: null,
  385. autoRefresh: null,
  386. interval: null,
  387. tileUrl: v => entity.setTileUrl(v), // not in options.
  388. };
  389. return commonUpdate (
  390. entity,
  391. newOptions,
  392. newEvents,
  393. oldOptions,
  394. oldEvents,
  395. operators,
  396. 'updateTraffic'
  397. )
  398. };
  399. ////////////////////////////////////////////////////////////
  400. // MassMarks, warning! is a layer!
  401. ////////////////////////////////////////////////////////////
  402. /**
  403. *
  404. * @param {*} AMap
  405. * @param {*} map
  406. * @param {*} options 如果有dom用来显示,则其中的content字段即被填充为dom,不再用独立参数表示dom
  407. * @param {*} events
  408. */
  409. export const createMassMarks = (options, events) => {
  410. const __func__ = 'createMassMarks';
  411. if (!window.AMap || !options || !options.map) {
  412. xdebug(__func__, 'fail! parameters!', 'window.AMap:'+!!window.AMap, 'options:'+!!options, 'options.map:'+!!(options&&options.map));
  413. return null;
  414. }
  415. let {map, data, style, ...restOpts} = options;
  416. let entity = new window.AMap.MassMarks(data||[], {...restOpts, style: style||[]});
  417. forOwn(events, (value, key) => {
  418. entity.on(key, value);
  419. });
  420. entity.setMap(map);
  421. xdebug(__func__, 'ok!', map, 'layers:', map.getLayers());
  422. return entity;
  423. };
  424. export const updateMassMarks = (
  425. entity,
  426. newOptions,
  427. newEvents,
  428. oldOptions,
  429. oldEvents
  430. ) => {
  431. let operators = {
  432. zIndex: v => entity.setzIndex(v),
  433. opacity: null,
  434. zooms: null,
  435. cursor: v => entity.setCursor(v),
  436. alwaysRender: null,
  437. style: v => entity.setStyle(v),
  438. map: v => {
  439. xdebug('updateMassMarks', 'setMap', v, 'layers:', (v && v.getLayers()));
  440. entity.setMap(v)
  441. },
  442. data: v=> {
  443. entity.setData(v);
  444. }
  445. };
  446. xdebug('updateMassMarks', 'mapOld:', (oldOptions && oldOptions.map && oldOptions.map.getLayers()), 'mapNew:', (newOptions && newOptions.map && newOptions.map.getLayers()));
  447. return commonUpdate (
  448. entity,
  449. newOptions,
  450. newEvents,
  451. oldOptions,
  452. oldEvents,
  453. operators,
  454. 'updateMassMarks'
  455. )
  456. };
  457. // ////////////////////////////////////////////////////////////
  458. // // Traffic, warning! is a layer!
  459. // ////////////////////////////////////////////////////////////
  460. // /**
  461. // *
  462. // * @param {*} window.AMap
  463. // * @param {*} map
  464. // * @param {*} options 如果有dom用来显示,则其中的content字段即被填充为dom,不再用独立参数表示dom
  465. // * @param {*} events
  466. // */
  467. // export const createTraffic = (options, events) => {
  468. // const __func__ = 'createTraffic';
  469. // if (!window.AMap || !options || !options.map) {
  470. // xdebug(__func__, 'fail! parameters!', 'window.AMap:'+!!window.AMap, 'options:'+!!options, 'options.map:'+!!(options&&options.map));
  471. // return null;
  472. // }
  473. // let {map, data, style, ...restOpts} = options;
  474. // // let entity = new window.AMap.TileLayer.Traffic(data, restOpts);
  475. // let entity = new window.AMap.Traffic(data||[], {...restOpts, style: style||[]});
  476. // forOwn(events, (value, key) => {
  477. // entity.on(key, value);
  478. // });
  479. // entity.setMap(map);
  480. // xdebug(__func__, 'ok!', map, 'layers:', map.getLayers());
  481. // return entity;
  482. // };
  483. // export const updateTraffic = (
  484. // entity,
  485. // newOptions,
  486. // newEvents,
  487. // oldOptions,
  488. // oldEvents
  489. // ) => {
  490. // let operators = {
  491. // map: v => entity.setMap(v),
  492. // zIndex: v => entity.setzIndex(v),
  493. // opacity: v => entity.setOpacity(v),
  494. // zooms: null,
  495. // detectRetina: null,
  496. // autoRefresh: null,
  497. // interval: null,
  498. // tileUrl: v => entity.setTileUrl(v), // not in options.
  499. // };
  500. // xdebug('updateTraffic', 'mapOld:', (oldOptions && oldOptions.map && oldOptions.map.getLayers()), 'mapNew:', (newOptions && newOptions.map && newOptions.map.getLayers()));
  501. // return commonUpdate (
  502. // entity,
  503. // newOptions,
  504. // newEvents,
  505. // oldOptions,
  506. // oldEvents,
  507. // operators,
  508. // 'updateTraffic'
  509. // )
  510. // };
  511. ////////////////////////////////////////////////////////////
  512. // Polygon
  513. ////////////////////////////////////////////////////////////
  514. /**
  515. *
  516. * @param {*} AMap
  517. * @param {*} map
  518. * @param {*} options 如果有dom用来显示,则其中的content字段即被填充为dom,不再用独立参数表示dom
  519. * @param {*} events
  520. */
  521. export const createPolygon = (options, events) => {
  522. const __func__ = 'createPolygon';
  523. if (!window.AMap || !options || !options.map) {
  524. xdebug(__func__, 'fail! parameters!', 'window.AMap:'+!!window.AMap, 'options:'+!!options, 'options.map:'+!!(options&&options.map));
  525. return null;
  526. }
  527. let entity = new window.AMap.Polygon(options);
  528. forOwn(events, (value, key) => {
  529. entity.on(key, value);
  530. });
  531. xdebug(__func__, 'ok!');
  532. return entity;
  533. };
  534. export const updatePolygon = (
  535. entity,
  536. newOptions,
  537. newEvents,
  538. oldOptions,
  539. oldEvents
  540. ) => {
  541. let operators = {
  542. map: v => entity.setMap(v),
  543. zIndex: v => entity.setzIndex(v),
  544. path: v => entity.setPath(v),
  545. bubble: null,
  546. cursor: null,
  547. strokeColor: null,
  548. strokeOpacity: null,
  549. strokeWeight: null,
  550. fillColor: null,
  551. fillOpacity: null,
  552. draggable: null,
  553. extData: v => entity.setExtData(v),
  554. strokeStyle: null,
  555. strokeDasharray: null,
  556. options: v => entity.setOptions(v)
  557. };
  558. return commonUpdate (
  559. entity,
  560. newOptions,
  561. newEvents,
  562. oldOptions,
  563. oldEvents,
  564. operators,
  565. 'updatePolygon'
  566. )
  567. };
  568. ////////////////////////////////////////////////////////////
  569. // Polyline
  570. ////////////////////////////////////////////////////////////
  571. /**
  572. *
  573. * @param {*} AMap
  574. * @param {*} map
  575. * @param {*} options 如果有dom用来显示,则其中的content字段即被填充为dom,不再用独立参数表示dom
  576. * @param {*} events
  577. */
  578. export const createPolyline = (options, events) => {
  579. const __func__ = 'createPolyline';
  580. if (!window.AMap || !options || !options.map) {
  581. xdebug(__func__, 'fail! parameters!', 'window.AMap:'+!!window.AMap, 'options:'+!!options, 'options.map:'+!!(options&&options.map));
  582. return null;
  583. }
  584. let entity = new window.AMap.Polyline(options);
  585. forOwn(events, (value, key) => {
  586. entity.on(key, value);
  587. });
  588. xdebug(__func__, 'ok!');
  589. return entity;
  590. };
  591. export const updatePolyline = (
  592. entity,
  593. newOptions,
  594. newEvents,
  595. oldOptions,
  596. oldEvents
  597. ) => {
  598. let operators = {
  599. map: v => entity.setMap(v),
  600. zIndex: v => entity.setzIndex(v),
  601. bubble: null,
  602. cursor: null,
  603. gedodesic: null,
  604. isOutline: null,
  605. borderWeight: null,
  606. outlineColor: null,
  607. path: v => entity.setPath(v),
  608. strokeColor: null,
  609. strokeOpacity: null,
  610. strokeWeight: null,
  611. strokeStyle: null,
  612. strokeDasharray: null,
  613. lineJoin: null,
  614. lineCap: null,
  615. draggable: null,
  616. extData: v => entity.setExtData(v),
  617. showDir: null,
  618. options: v => entity.setOptions(v)
  619. };
  620. return commonUpdate (
  621. entity,
  622. newOptions,
  623. newEvents,
  624. oldOptions,
  625. oldEvents,
  626. operators,
  627. 'updatePolyline'
  628. )
  629. };
  630. ////////////////////////////////////////////////////////////
  631. // InfoWindow
  632. ////////////////////////////////////////////////////////////
  633. /**
  634. *
  635. * @param {*} AMap
  636. * @param {*} map
  637. * @param {*} options 如果有dom用来显示,则其中的content字段即被填充为dom,不再用独立参数表示dom
  638. * @param {*} events
  639. */
  640. export const createInfoWindow = (options, events) => {
  641. const __func__ = 'createInfoWindow';
  642. if (!window.AMap || !options || !options.map) {
  643. xdebug(__func__, 'fail! parameters!', 'window.AMap:'+!!window.AMap, 'options:'+!!options, 'options.map:'+!!(options&&options.map));
  644. return null;
  645. }
  646. let entity = new window.AMap.InfoWindow(options);
  647. forOwn(events, (value, key) => {
  648. entity.on(key, value);
  649. });
  650. xdebug(__func__, 'ok!');
  651. return entity;
  652. };
  653. export const updateInfoWindow = (
  654. entity,
  655. newOptions,
  656. newEvents,
  657. oldOptions,
  658. oldEvents
  659. ) => {
  660. let operators = {
  661. isCustom: null,
  662. autoMove: null,
  663. closeWhenClickMap: null,
  664. content: v => entity.setContent(v),
  665. size: v => entity.setSize(v),
  666. offset: null,
  667. position: v => entity.setPosition(v),
  668. showShadow: null,
  669. };
  670. return commonUpdate (
  671. entity,
  672. newOptions,
  673. newEvents,
  674. oldOptions,
  675. oldEvents,
  676. operators,
  677. 'updateInfoWindow'
  678. )
  679. };