CesiumGS / cesium-google-earth-examples

Google Earth plugin API samples ported to Cesium
Apache License 2.0
94 stars 54 forks source link

Infobox Examples #21

Closed hpinkos closed 9 years ago

hpinkos commented 9 years ago

@mramato is there a better way to do some of these things? If I want an infobox that displays information for an entity, its beautifully simple. But if I just want to display some other information, or show/hide the box via code I have to create a new InfoBox() because the viewer has too much control over viewer.infoBox

Also, it seems like the html sanitizer is scrubbing out images and links. Is there a way around this? Some of the google earth examples have images, embedded videos and links that call javascript commands onclick, is there a way we can do this too?

pjcozzi commented 9 years ago

+1 for a really easy way to do this.

pjcozzi commented 9 years ago

@mramato for 1.6? Or we can roll this out later. Either is OK with me.

mramato commented 9 years ago

In the long run we want to loosen up the sanitizer restrictions so that images and links work by default, this is important for KML, I just haven't had a chance to look into it yet.

For this demo in the short term you can disable the sanitizer completely with something like: Cesium.InfoBoxViewModel.defaultSanitizer = function(html){return html;}; Although I'll want to change this before we ship to at least to allow for Cesium.InfoBoxViewModel.defaultSanitizer = undefined, which currently doesn't work (I think).

As for other InfoBox stuff, I haven't looked at the example, but can't you just create an entity out of thin air and assign it to selectedEntity? That should work.

As soon as everything I'm working on is ready for master, I plan on looking through everything in this branch and finding easier ways to do things that are not straightforward or making slow things faster. It's up to you if you want to keep this open until then or merge it and wait for the next pass.

pjcozzi commented 9 years ago

We have enough on our plates. Let's wait until post 1.6.

pjcozzi commented 9 years ago

@mramato should we just close this for now?