ADD: added possibility to drag marker and get the new position for updating a entity

This commit is contained in:
hwinkel
2023-10-01 10:22:37 +02:00
parent 3a3901fbec
commit 229a4d7906
4 changed files with 91 additions and 21 deletions

View File

@@ -29,7 +29,7 @@ const client = new W3CWebSocket("ws://"+config.apiUrl+":"+config.apiProt+"/");
class App extends Component {
state = {
Entities: [],
EntityOnFocus: []
EntityOnFocus: undefined
}
componentDidMount() {
@@ -41,7 +41,7 @@ class App extends Component {
client.onmessage = (message) => {
const dataFromServer = JSON.parse(message.data);
console.log('reply: ', dataFromServer);
// console.log('reply: ', dataFromServer);
if(dataFromServer.Data === "COP")
{
@@ -97,6 +97,7 @@ class App extends Component {
setEntityOnFocus(Entity)
{
// console.log(Entity);
this.setState({
EntityOnFocus: Entity