zrUtil.each(mapModelGroupBySeries, function (mapSeries, mapType) { var mapData = mapDataStores[mapType]; if (!mapData) { mapNotExistsError(name); } var nameMapList = zrUtil.map(mapSeries, function (singleMapSeries) { return singleMapSeries.get('nameMap'); }); var geo = new Geo( mapType, mapType, mapData && mapData.geoJson, mapData && mapData.specialAreas, zrUtil.mergeAll(nameMapList) ); geoList.push(geo); // Inject resize method geo.resize = resizeGeo; geo.resize(mapSeries[0], api); zrUtil.each(mapSeries, function (singleMapSeries) { singleMapSeries.coordinateSystem = geo; setGeoCoords(geo, singleMapSeries); }); });
var markAreaTransform = function (seriesModel, coordSys, maModel, item) { var lt = markerHelper.dataTransform(seriesModel, item[0]); var rb = markerHelper.dataTransform(seriesModel, item[1]); var retrieve = zrUtil.retrieve; // FIXME make sure lt is less than rb var ltCoord = lt.coord; var rbCoord = rb.coord; ltCoord[0] = retrieve(ltCoord[0], -Infinity); ltCoord[1] = retrieve(ltCoord[1], -Infinity); rbCoord[0] = retrieve(rbCoord[0], Infinity); rbCoord[1] = retrieve(rbCoord[1], Infinity); // Merge option into one var result = zrUtil.mergeAll([{}, lt, rb]); result.coord = [ lt.coord, rb.coord ]; result.x0 = lt.x; result.y0 = lt.y; result.x1 = rb.x; result.y1 = rb.y; return result; };
zrUtil.each(AXIS_TYPES, function (axisType) { BaseAxisModelClass.extend({ /** * @readOnly */ type: axisName + 'Axis.' + axisType, mergeDefaultAndTheme: function (option, ecModel) { var layoutMode = this.layoutMode; var inputPositionParams = layoutMode ? getLayoutParams(option) : {}; var themeModel = ecModel.getTheme(); zrUtil.merge(option, themeModel.get(axisType + 'Axis')); zrUtil.merge(option, this.getDefaultOption()); option.type = axisTypeDefaulter(axisName, option); if (layoutMode) { mergeLayoutParam(option, inputPositionParams, layoutMode); } }, /** * @override */ optionUpdated: function () { var thisOption = this.option; if (thisOption.type === 'category') { this.__ordinalMeta = OrdinalMeta.createByAxisModel(this); } }, /** * Should not be called before all of 'getInitailData' finished. * Because categories are collected during initializing data. */ getCategories: function () { // FIXME // warning if called before all of 'getInitailData' finished. if (this.option.type === 'category') { return this.__ordinalMeta.categories; } }, getOrdinalMeta: function () { return this.__ordinalMeta; }, defaultOption: zrUtil.mergeAll([{}, axisDefault[axisType + 'Axis'], extraDefaultOption], true) }); });