Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasneirynck committed Apr 23, 2019
1 parent dcdb81f commit c71806f
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,21 @@ export class LayerTocActions extends Component {
state = {
isPopoverOpen: false,
supportsFitToBounds: false,
supportsDrawFilter: false
};

componentDidMount() {
this._isMounted = true;
this._loadSupportedActions();
this._loadSupportsFitToBounds();
}

componentWillUnmount() {
this._isMounted = false;
}

async _loadSupportedActions() {
async _loadSupportsFitToBounds() {
const supportsFitToBounds = await this.props.layer.supportsFitToBounds();
const supportsDrawFilter = this.props.layer.supportsDrawFilter();
if (this._isMounted) {
this.setState({ supportsFitToBounds, supportsDrawFilter });
this.setState({ supportsFitToBounds });
}
}

Expand Down Expand Up @@ -121,7 +119,9 @@ export class LayerTocActions extends Component {
}
return smallLegendIcon;
}
_getItems() {

_getPanels() {

const visibilityToggle = this._getVisbilityIcon();
const actionItems = [
{
Expand Down Expand Up @@ -202,7 +202,7 @@ export class LayerTocActions extends Component {
>
<EuiContextMenu
initialPanelId={0}
panels={this._getItems()}
panels={this._getPanels()}
data-test-subj={`layerTocActionsPanel${cleanDisplayName(this.props.displayName)}`}
/>
</EuiPopover>);
Expand Down
4 changes: 0 additions & 4 deletions x-pack/plugins/maps/public/shared/layers/heatmap_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ export class HeatmapLayer extends AbstractLayer {
return [this._getMbLayerId()];
}

supportsDrawFilter() {
return true;
}

syncLayerWithMB(mbMap) {

const mbSource = mbMap.getSource(this.getId());
Expand Down
4 changes: 0 additions & 4 deletions x-pack/plugins/maps/public/shared/layers/layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ export class AbstractLayer {
return await this._source.supportsFitToBounds();
}

supportsDrawFilter() {
return false;
}

async getDisplayName() {
if (this._descriptor.label) {
return this._descriptor.label;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ export class ESGeoGridSource extends AbstractESSource {
);
}

supportsDrawFilter() {
return true;
}

async getImmutableProperties() {
let indexPatternTitle = this._descriptor.indexPatternId;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ export class ESSearchSource extends AbstractESSource {
};
return (<CreateSourceEditor onSelect={onSelect}/>);
}
supportsDrawFilter() {
//todo. not quite right. only if source is geo_point
return true;
}

constructor(descriptor, inspectorAdapters) {
super({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ export class AbstractVectorSource extends AbstractSource {
});
}

supportsDrawFilter() {
return false;
}

isFilterByMapBounds() {
return false;
}
Expand Down
4 changes: 0 additions & 4 deletions x-pack/plugins/maps/public/shared/layers/tile_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ export class TileLayer extends AbstractLayer {
return [this._getMbLayerId()];
}

supportsDrawFilter() {
return false;
}

syncLayerWithMB(mbMap) {

const source = mbMap.getSource(this.getId());
Expand Down
7 changes: 0 additions & 7 deletions x-pack/plugins/maps/public/shared/layers/vector_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,6 @@ export class VectorLayer extends AbstractLayer {
return [VectorStyle];
}

supportsDrawFilter() {
//todo:
//this is wrong. _source should take into a account weather the source is geo_shape or geo_point. spatial filters are not supported by geo_shape backed index-patterns.
return this._source.supportsDrawFilter();
}


/**
* this should only be called if the source supports shape filter creation.
* @return {*|Promise<void>}
Expand Down

0 comments on commit c71806f

Please sign in to comment.