Skip to content
Snippets Groups Projects
Commit 2335cb51 authored by Janne Alatalo's avatar Janne Alatalo :neutral_face:
Browse files

Remove the old unused tooltip code

parent 4dd9d956
No related branches found
No related tags found
No related merge requests found
Pipeline #4046 passed
.App {
text-align: center;
}
.tooltip {
position: absolute;
display: inline-block;
border-bottom: 1px dotted black; /* If you want dots under the hoverable text */
z-index: 10;
}
.tooltip .tooltiptext {
visibility: hidden;
width: 120px;
background-color: black;
color: #fff;
text-align: center;
padding: 5px 0;
border-radius: 6px;
position: absolute;
}
......@@ -7,8 +7,6 @@ import CardActions from '@material-ui/core/CardActions';
import Button from '@material-ui/core/Button';
import Typography from '@material-ui/core/Typography';
import Tooltip from './Tooltip.js';
const polygon_size = 0.01
const polygon_size_lat = polygon_size * 2
const polygon_size_lon = polygon_size
......@@ -31,20 +29,6 @@ class PointMap extends Component {
this.state = { viewport, mouseover, clicked };
}
update_tooltip(visible, x, y, content) {
this.setState((prevState) => {
let tooltipVisible = visible;
y -= 20;
x += 10;
let tooltip = {x, y, content};
return {
...prevState,
tooltipVisible,
tooltip,
};
});
}
handleOnHover(e) {
this.setState(prevState => {
let mouseover = null;
......@@ -213,7 +197,6 @@ class PointMap extends Component {
viewState={this.state.viewport}
/>
</DeckGL>
{this.state.tooltipVisible && <Tooltip {...this.state.tooltip} />}
{ this.state.clicked &&
this.getCard(this.state.clicked)
}
......
import React from 'react';
export default function Tooltip({ x, y, content }) {
return (
<div className="tooltip" style={{left: x, top: y}}>
<div>{content}</div>
</div>
);
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment