提交 03c34608 编写于 作者: P pah100

Merge branch 'dev-3.0.0' of https://github.com/ecomfe/echarts into dev-3.0.0

...@@ -45,15 +45,6 @@ define(function (require) { ...@@ -45,15 +45,6 @@ define(function (require) {
var featureModel = new Model(featureOpt, toolboxModel, toolboxModel.ecModel); var featureModel = new Model(featureOpt, toolboxModel, toolboxModel.ecModel);
var feature; var feature;
featureModel.setIconStatus = function (iconName, status) {
var option = this.option;
var iconPaths = this.iconPaths;
option.iconStatus = option.iconStatus || {};
option.iconStatus[iconName] = status;
// FIXME
iconPaths[iconName] && iconPaths[iconName].trigger(status);
};
if (featureName && !oldName) { // Create if (featureName && !oldName) { // Create
var Feature = featureManager.get(featureName); var Feature = featureManager.get(featureName);
if (!Feature) { if (!Feature) {
...@@ -63,6 +54,7 @@ define(function (require) { ...@@ -63,6 +54,7 @@ define(function (require) {
} }
else { else {
feature = features[oldName]; feature = features[oldName];
feature.model = featureModel;
} }
if (!featureName && oldName) { if (!featureName && oldName) {
...@@ -76,6 +68,16 @@ define(function (require) { ...@@ -76,6 +68,16 @@ define(function (require) {
} }
createIconPaths(featureModel, feature, featureName); createIconPaths(featureModel, feature, featureName);
featureModel.setIconStatus = function (iconName, status) {
var option = this.option;
var iconPaths = this.iconPaths;
option.iconStatus = option.iconStatus || {};
option.iconStatus[iconName] = status;
// FIXME
iconPaths[iconName] && iconPaths[iconName].trigger(status);
};
} }
function createIconPaths(featureModel, feature, featureName) { function createIconPaths(featureModel, feature, featureName) {
...@@ -110,10 +112,7 @@ define(function (require) { ...@@ -110,10 +112,7 @@ define(function (require) {
var path = graphic.makePath( var path = graphic.makePath(
icon, { icon, {
style: normalStyle, style: normalStyle,
hoverStyle: zrUtil.extend({ hoverStyle: hoverStyle,
textPosition: 'bottom',
textFill: hoverStyle.fill || hoverStyle.stroke || '#000'
}, hoverStyle),
rectHover: true rectHover: true
}, { }, {
x: -itemSize / 2, x: -itemSize / 2,
...@@ -127,10 +126,16 @@ define(function (require) { ...@@ -127,10 +126,16 @@ define(function (require) {
if (toolboxModel.get('showTitle')) { if (toolboxModel.get('showTitle')) {
path.on('mouseover', function () { path.on('mouseover', function () {
path.setStyle('text', titles[iconName]); path.setStyle({
textPosition: 'bottom',
text: titles[iconName],
textFill: hoverStyle.fill || hoverStyle.stroke || '#000'
});
}) })
.on('mouseout', function () { .on('mouseout', function () {
path.setStyle('text', ''); path.setStyle({
textFill: null
});
}); });
} }
path.trigger(featureModel.get('iconStatus.' + iconName) || 'normal'); path.trigger(featureModel.get('iconStatus.' + iconName) || 'normal');
......
...@@ -49,7 +49,6 @@ define(function (require) { ...@@ -49,7 +49,6 @@ define(function (require) {
inside: false, inside: false,
rotate: 0, rotate: 0,
margin: 8, margin: 8,
// clickable: false,
// formatter: null, // formatter: null,
// 其余属性默认使用全局文本样式,详见TEXTSTYLE // 其余属性默认使用全局文本样式,详见TEXTSTYLE
textStyle: { textStyle: {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册