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

@@ -22,21 +22,23 @@ function EntityControl(props)
useEffect(() => { // Update the document title using the browser API document.title = `You clicked ${count} times`;
console.log(props.Entity);
// console.log(props.Entity);
setEntity(props.Entity);
if(CourseInControl === false)
{
// setSpeed(props.Entity.Speed);
if(Array.isArray(props.Entity.Position) === true)
if(props.Entity !== undefined)
{
setFormData({name:props.Entity.Name,course:props.Entity.Course,speed:props.Entity.Speed,position:props.Entity.Position})
}else{
setFormData({name:props.Entity.Name,course:props.Entity.Course,speed:props.Entity.Speed,position:['','']})
setFormData({name:"",course:"",speed:"",position:['','']})
}
// setFormData({speed:props.Entity.Speed})
}