Exit Fullscreen In JS

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

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

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
RobertScheitlin__GISP
MVP Esteemed Contributor
GregoryBologna
Occasional Contributor

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 Esteemed Contributor

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