Change Entity value from Infobox button

Dear Masters,

I’m new with cesium and I tried to make some application using some dynamic data.

I have entities that generated by database and Infobox with some result of the database query.
the cesium part like below:

var markers = JSON.parse(response);
for (var i = 0; i < markers.length; i++) {
var name = markers[i].name;
var type = markers[i].type;
var html = “” + name + “
” + type + '
<input type=“image” class=“check_update” src=“images/search.png” ’
var marker = viewer.entities.add({
name : name,
description: type
position : Cesium.Cartesian3.fromDegrees(longitude, latitude),
billboard : {
image : ‘images/office-building.png’,
}
});
};

With the dynamic data from database, I want to change the image, when the type value changes on some of the entities from the loop.
I made some html button, check_update in the InfoBox, when the button clicked, I want to change the image and content of the Infobox.

How to make it happened?
When I use viewer.entities.remove(name), the entity that have the name not clear and the image still there not changed.
The changes just on the image, I have another image office-building-new.png to replace the office-building.png

Please help.

Regards,
Fadjar Tandabawana

Hello Fadjar,

The easiest way to update the infobox would be to set marker.description to the new value.

Best,

Hannah

Dear Hannah,

My next function is to erplace the marker description value, but no luck.
I put viewer.entities.remove(name); also no result what I’m expected.

I was succeeded if i put viewer.entities.removeAll but I need to change one of the loop result in specific InfoBox.
The button in InfoBox working well and I can alert the result. Only the function to change the entity and description was not worked.

What I want is the marker remove first then appear again with the button click in selected infoBox.

Regards,
Fadjar Tandabawana

Hi…

I should report this:

  1. I use version 1.28
    The problem that I wrote in this subject was solved, not in 1.27, but I have another bug, I think, the InfoBox getting confused each other. I have more than 100 infobox, when I choose another infobox, the old infobox that I was opened, got the message that I point to other Infobox

  2. I use 1.27
    The renew of InfoBox not worked but the message for specific Infobox, did not goes to other infobox

Conclusion:
I think, 1.28 have a bug for Infobox handling.

I just copied my application to 1.28 and I found this, if there any command or workaround to bring back the 1.27 infobox handling, it will help me …

Regards,
Fadjar Tandabawana