-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #810 from Flexberry/wi_234045_comboStyle
combo style
- Loading branch information
Showing
27 changed files
with
942 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
import Ember from 'ember'; | ||
import layout from '../../../templates/components/legends/layers-styles/simple'; | ||
import SimpleLayerStyleLegendComponent from './simple'; | ||
|
||
/** | ||
Component representing legend for vector layer with 'simple' style. | ||
@class SimpleLayerStyleLegendComponent | ||
@extends BaseLayerStyleLegendComponent | ||
*/ | ||
export default SimpleLayerStyleLegendComponent.extend({ | ||
/** | ||
Flag: indicates whether to show linear & polygonal objects on legend or not. | ||
@property _geometriesCanBeDisplayed | ||
@type Boolean | ||
@private | ||
@readOnly | ||
*/ | ||
_geometriesCanBeDisplayed: Ember.computed('legendSettings.geometriesCanBeDisplayed', function() { | ||
return this.get('legendSettings.geometriesCanBeDisplayed') !== false; | ||
}), | ||
|
||
/** | ||
Flag: indicates whether to show point objects on legend or not. | ||
@property _markersCanBeDisplayed | ||
@type Boolean | ||
@private | ||
@readOnly | ||
*/ | ||
_markersCanBeDisplayed: Ember.computed('legendSettings.markersCanBeDisplayed', function() { | ||
return this.get('legendSettings.markersCanBeDisplayed') !== false; | ||
}), | ||
|
||
/** | ||
Reference to component's template. | ||
*/ | ||
layout, | ||
|
||
/** | ||
Legend width (for image only, without label). | ||
@property width | ||
@type Number | ||
@default 24 | ||
*/ | ||
width: 24, | ||
|
||
/** | ||
Legend height (for image only, without label). | ||
@property height | ||
@type Number | ||
@default 24 | ||
Reference to component's template. | ||
*/ | ||
height: 24, | ||
|
||
/** | ||
Renderes legends each time component gets rendered. | ||
*/ | ||
didRender() { | ||
this._super(...arguments); | ||
|
||
if (this.get('_geometriesCanBeDisplayed')) { | ||
let styleSettings = this.get('styleSettings'); | ||
let canvas = this.$('canvas.geometries')[0]; | ||
|
||
let layersStylesRenderer = this.get('_layersStylesRenderer'); | ||
let legendStyle = this.parentView.layer.legendStyle; | ||
if (!Ember.isNone(legendStyle)) { | ||
styleSettings = layersStylesRenderer.getDefaultStyleSettings('simple'); | ||
for (let opt in legendStyle.style.path) { | ||
styleSettings.style.path[opt] = legendStyle.style.path[opt]; | ||
} | ||
} | ||
|
||
layersStylesRenderer.renderOnCanvas({ | ||
styleSettings: styleSettings, | ||
canvas: canvas, | ||
target: 'legend' | ||
}); | ||
} | ||
|
||
if (this.get('_markersCanBeDisplayed')) { | ||
let styleSettings = Ember.isNone(this.parentView.layer.legendStyle) ? this.get('styleSettings.style.marker') : this.parentView.layer.legendStyle; | ||
let canvas = this.$('canvas.markers')[0]; | ||
|
||
let markersStylesRenderer = this.get('_markersStylesRenderer'); | ||
markersStylesRenderer.renderOnCanvas({ | ||
styleSettings: styleSettings, | ||
canvas: canvas, | ||
target: 'legend' | ||
}); | ||
} | ||
} | ||
}); |
Oops, something went wrong.