|
@@ -493,63 +493,6 @@ export var updateMassMarks = function updateMassMarks(entity, newOptions, newEve
|
|
|
return commonUpdate(entity, newOptions, newEvents, oldOptions, oldEvents, operators, 'updateMassMarks');
|
|
|
};
|
|
|
|
|
|
-// ////////////////////////////////////////////////////////////
|
|
|
-// // Traffic, warning! is a layer!
|
|
|
-// ////////////////////////////////////////////////////////////
|
|
|
-// /**
|
|
|
-// *
|
|
|
-// * @param {*} window.AMap
|
|
|
-// * @param {*} map
|
|
|
-// * @param {*} options 如果有dom用来显示,则其中的content字段即被填充为dom,不再用独立参数表示dom
|
|
|
-// * @param {*} events
|
|
|
-// */
|
|
|
-// export const createTraffic = (options, events) => {
|
|
|
-// const __func__ = 'createTraffic';
|
|
|
-// if (!window.AMap || !options || !options.map) {
|
|
|
-// xdebug(__func__, 'fail! parameters!', 'window.AMap:'+!!window.AMap, 'options:'+!!options, 'options.map:'+!!(options&&options.map));
|
|
|
-// return null;
|
|
|
-// }
|
|
|
-// let {map, data, style, ...restOpts} = options;
|
|
|
-// // let entity = new window.AMap.TileLayer.Traffic(data, restOpts);
|
|
|
-// let entity = new window.AMap.Traffic(data||[], {...restOpts, style: style||[]});
|
|
|
-// forOwn(events, (value, key) => {
|
|
|
-// entity.on(key, value);
|
|
|
-// });
|
|
|
-// entity.setMap(map);
|
|
|
-// xdebug(__func__, 'ok!', map, 'layers:', map.getLayers());
|
|
|
-// return entity;
|
|
|
-// };
|
|
|
-
|
|
|
-// export const updateTraffic = (
|
|
|
-// entity,
|
|
|
-// newOptions,
|
|
|
-// newEvents,
|
|
|
-// oldOptions,
|
|
|
-// oldEvents
|
|
|
-// ) => {
|
|
|
-// let operators = {
|
|
|
-// map: v => entity.setMap(v),
|
|
|
-// zIndex: v => entity.setzIndex(v),
|
|
|
-// opacity: v => entity.setOpacity(v),
|
|
|
-// zooms: null,
|
|
|
-// detectRetina: null,
|
|
|
-// autoRefresh: null,
|
|
|
-// interval: null,
|
|
|
-// tileUrl: v => entity.setTileUrl(v), // not in options.
|
|
|
-// };
|
|
|
-// xdebug('updateTraffic', 'mapOld:', (oldOptions && oldOptions.map && oldOptions.map.getLayers()), 'mapNew:', (newOptions && newOptions.map && newOptions.map.getLayers()));
|
|
|
-
|
|
|
-// return commonUpdate (
|
|
|
-// entity,
|
|
|
-// newOptions,
|
|
|
-// newEvents,
|
|
|
-// oldOptions,
|
|
|
-// oldEvents,
|
|
|
-// operators,
|
|
|
-// 'updateTraffic'
|
|
|
-// )
|
|
|
-// };
|
|
|
-
|
|
|
////////////////////////////////////////////////////////////
|
|
|
// Polygon
|
|
|
////////////////////////////////////////////////////////////
|
|
@@ -607,6 +550,64 @@ export var updatePolygon = function updatePolygon(entity, newOptions, newEvents,
|
|
|
};
|
|
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
+// Circle
|
|
|
+////////////////////////////////////////////////////////////
|
|
|
+/**
|
|
|
+ *
|
|
|
+ * @param {*} AMap
|
|
|
+ * @param {*} map
|
|
|
+ * @param {*} options 如果有dom用来显示,则其中的content字段即被填充为dom,不再用独立参数表示dom
|
|
|
+ * @param {*} events
|
|
|
+ */
|
|
|
+export var createCircle = function createCircle(options, events) {
|
|
|
+ var __func__ = 'createCircle';
|
|
|
+ if (!window.AMap || !options || !options.map) {
|
|
|
+ xdebug(__func__, 'fail! parameters!', 'window.AMap:' + !!window.AMap, 'options:' + !!options, 'options.map:' + !!(options && options.map));
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ var entity = new window.AMap.Circle(options);
|
|
|
+ forOwn(events, function (value, key) {
|
|
|
+ entity.on(key, value);
|
|
|
+ });
|
|
|
+ xdebug(__func__, 'ok!');
|
|
|
+ return entity;
|
|
|
+};
|
|
|
+
|
|
|
+export var updateCircle = function updateCircle(entity, newOptions, newEvents, oldOptions, oldEvents) {
|
|
|
+ var operators = {
|
|
|
+ map: function map(v) {
|
|
|
+ return entity.setMap(v);
|
|
|
+ },
|
|
|
+ zIndex: function zIndex(v) {
|
|
|
+ return entity.setzIndex(v);
|
|
|
+ },
|
|
|
+ center: function center(v) {
|
|
|
+ return entity.setCenter(v);
|
|
|
+ },
|
|
|
+ bubble: null,
|
|
|
+ cursor: null,
|
|
|
+ radius: function radius(v) {
|
|
|
+ return entity.setRadius(v);
|
|
|
+ },
|
|
|
+ strokeColor: null,
|
|
|
+ strokeOpacity: null,
|
|
|
+ strokeWeight: null,
|
|
|
+ fillColor: null,
|
|
|
+ fillOpacity: null,
|
|
|
+ strokeStyle: null,
|
|
|
+ extData: function extData(v) {
|
|
|
+ return entity.setExtData(v);
|
|
|
+ },
|
|
|
+ strokeDasharray: null,
|
|
|
+ options: function options(v) {
|
|
|
+ return entity.setOptions(v);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ return commonUpdate(entity, newOptions, newEvents, oldOptions, oldEvents, operators, 'updateCircle');
|
|
|
+};
|
|
|
+
|
|
|
+////////////////////////////////////////////////////////////
|
|
|
// Polyline
|
|
|
////////////////////////////////////////////////////////////
|
|
|
/**
|