CesiumGS / cesium-google-earth-examples

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

Fullscreen brings the whole HTML page fullscreen #7

Closed pjcozzi closed 9 years ago

pjcozzi commented 9 years ago

Local link: http://localhost:8080/examples/groundoverlay.html

image

Can we organize the Resource links such that they will be under the viewer canvas in fullscreen instead of on top? @mramato is it possible to just make the viewer canvas fullscreen?

mramato commented 9 years ago

You can pass the element you want to the viewer constructor. However, we'll probably need to tweak the CSS. I also found an issue where fullScreenElement only takes an element, when it should allow for a string as well. I'll open a PR in Cesium to fix that; until then, this is what the code would look like.

var cesiumContainer = document.getElementById('cesiumContainer');
var viewer = new Cesium.Viewer(cesiumContainer, {
  fullscreenElement : cesiumContainer
});

That ends up only having the viewer window, but it's not size properly (which should itself be an easy fix).

pjcozzi commented 9 years ago

Is it safe to merge master to implicit-properties so we can upgrade here to the latest entity API and fullscreen fix?

Would it be better to have fullscreenElement default to the viewer? That is probably the common case, right? I would prefer us not to set it in every example.

mramato commented 9 years ago

I already did the merge, so you are good to go there.

It used to be the viewer by default, but we got a ton of emails on the mailing list about how it didn't behave the way they expected it to. Basically, what it comes down to is if your app takes up the whole browser window, (which is the typical use case) document.body is the better default. That all being said, I believe we can tweak the CSS you're using to make the default behavior have the viewer widget only for fullscreen; no code changes in Cesium required.

pjcozzi commented 9 years ago

Upgraded Cesium in #9.

I believe we can tweak the CSS you're using to make the default behavior have the viewer widget only for fullscreen; no code changes in Cesium required.

I dig it.

mramato commented 9 years ago

I dig it.

To keep myself honest, I prototyped this in the fullscreen branch and got it working in Chrome and IE (but not Firefox yet). I'm completely confident it can be done in Firefox too, I just need to spend more time with the examples.css.

pjcozzi commented 9 years ago

@mramato what is the state of this? Do we still care about this in the near-term?