Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Commit

Permalink
pass onCreateHeatmap callback through
Browse files Browse the repository at this point in the history
  • Loading branch information
stazrad committed Aug 18, 2021
1 parent 5b8c6a3 commit 4351a98
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/LayerPanel/LayerPanelLayersPage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ class LayerPanelLayersPage extends Component {
render () {
const {
translations, layerFilter, handleFeatureDoubleClick, handleLayerDoubleClick, disableDrag, tabIcon, onLayerRemoved,
onLayerReorder, enableFilter, getMenuItemsForLayer, shouldAllowLayerRemoval, map, onExportFeatures, onMergeLayers
onLayerReorder, enableFilter, getMenuItemsForLayer, shouldAllowLayerRemoval, map, onExportFeatures, onMergeLayers, onCreateHeatmap
} = this.props
const { layers, masterCheckboxVisibility, filterText, expandedLayers } = this.state
const isExpandedLayer = (layer) => !!expandedLayers.find(expandedLayerId => expandedLayerId === layer.ol_uid)
Expand Down Expand Up @@ -439,7 +439,7 @@ class LayerPanelLayersPage extends Component {
{getMenuItemsForLayer(layer) ||
[<LayerPanelActionRemove key='removeLayer' shouldAllowLayerRemoval={shouldAllowLayerRemoval} />,
<LayerPanelActionExtent key='gotoExtent' />,
<LayerPanelActionHeatmap key='heatmap' layer={layer} />,
<LayerPanelActionHeatmap key='heatmap' layer={layer} onCreateHeatmap={onCreateHeatmap} />,
<LayerPanelActionOpacity key='layerOpacity' />]}
</LayerPanelActions>
</ListItemSecondaryAction>
Expand Down Expand Up @@ -476,6 +476,7 @@ LayerPanelLayersPage.defaultProps = {
shouldHideFeatures: (layer) => false,
shouldAllowLayerRemoval: (layer) => true,
getMenuItemsForLayer: () => false,
onCreateHeatmap: () => {},
tabIcon: <LayersIcon />,
setHoverStyle: () => ({ color: 'red', fill: '#ffffff', stroke: 'red' }),
disableHover: false
Expand Down Expand Up @@ -515,6 +516,9 @@ LayerPanelLayersPage.propTypes = {
/** A callback function to determine if a given layer should be allowed to be removed from the panel page display */
shouldAllowLayerRemoval: PropTypes.func,

/** A callback fired when a new heatmap is created */
onCreateHeatmap: PropTypes.func,

/** A callback function that returns the file type and the features that are being exported */
onExportFeatures: PropTypes.func,

Expand Down
1 change: 1 addition & 0 deletions src/LayerPanel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export { default as LayerPanelActionExtent } from './LayerPanelActionExtent'
export { default as LayerPanelActionImport } from './LayerPanelActionImport'
export { default as LayerPanelActionOpacity } from './LayerPanelActionOpacity'
export { default as LayerPanelActionMerge } from './LayerPanelActionMerge'
export { default as LayerPanelActionHeatmap } from './LayerPanelActionHeatmap'
export * from './LayerPanelActionExport/utils'
export * from './LayerPanelActionHeatmap/utils'
export * from './LayerPanelActionMerge/utils'
3 changes: 2 additions & 1 deletion src/Popup/PopupActions/PopupActionCut/PopupActionCut.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ class ActionCut extends Component {

render () {
const { showSnackbar } = this.state
const { translations } = this.props

return (
<>
<PopupActionItem title={'_ol_kit.PopupActionCut.title'} onClick={() => this.cut()} />
<PopupActionItem title={translations['_ol_kit.PopupActionCut.title']} onClick={() => this.cut()} />
<Snackbar
open={showSnackbar}
closeSnackbar={() => this.setState({ showSnackbar: false })}
Expand Down
1 change: 1 addition & 0 deletions src/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ Object {
"LayerPanel": [Function],
"LayerPanelActionExport": [Function],
"LayerPanelActionExtent": [Function],
"LayerPanelActionHeatmap": [Function],
"LayerPanelActionImport": [Function],
"LayerPanelActionMerge": [Function],
"LayerPanelActionOpacity": [Function],
Expand Down

0 comments on commit 4351a98

Please sign in to comment.