Exit Fullscreen In JS

1149
3
Jump to solution
05-02-2019 01:14 PM
GregoryBologna
Occasional Contributor II

If I'm adding the fullscreen widget and activate fullscreen by clicking the widget, how do I programmatically exit fullscreen?

        var fullscreen = new Fullscreen({
          view: view,
          element: aerialViewMap
        });
0 Kudos
1 Solution

Accepted Solutions
GregoryBologna
Occasional Contributor II

Got it. Thanks.

I had tried that but my fullscreen.viewModel was out of scope because I was calling it inside a trigger-action that was inside an IdentifyTask.

        var viewTrigger = view.popup.on("trigger-action", function (event) {
          if (event.action.id === "goto-parcel") {
            if (fullscreen.viewModel.state === 'active') {
              fullscreen.viewModel.exit();
            }
            var parid = view.popup.selectedFeature.attributes.PARID;
            switchOwner(parid);
          }
        }); // end trigger-action

View solution in original post

0 Kudos
3 Replies
GregoryBologna
Occasional Contributor II

Got it. Thanks.

I had tried that but my fullscreen.viewModel was out of scope because I was calling it inside a trigger-action that was inside an IdentifyTask.

        var viewTrigger = view.popup.on("trigger-action", function (event) {
          if (event.action.id === "goto-parcel") {
            if (fullscreen.viewModel.state === 'active') {
              fullscreen.viewModel.exit();
            }
            var parid = view.popup.selectedFeature.attributes.PARID;
            switchOwner(parid);
          }
        }); // end trigger-action
0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Don't forget to mark this question as answered by clicking on the "Mark Correct" link on the reply that answered your question.

0 Kudos