ArcGIS Javascript API v3.29 - Mobile infoWindow fullscreen on touch

232
2
Jump to solution
09-20-2019 12:46 PM
MaximeDemers
Occasional Contributor III

Hi,

I would like to know if it's possible to show the infoWindow directly fullscreen after a touch event on mobile instead of showing a small popup in which you have to click again to display the info fullscreen.

I would like to prevent this popup above and automatically show the fullscreen InfoWindow like below.

It's for a 2D WAB application in version 2.13 so the ArcGIS Javascript API version is 3.29.

Any suggestion?

Thank you!

0 Kudos
1 Solution

Accepted Solutions
CarlosAugusto_Nantes_de_Castil
New Contributor III

A quick and dirty way of doing it, could be something like this:

function configurePopupMobileToMaximize (map) {
    require(['dojo/aspect'], function(aspect){
            aspect.after(map.infoWindow'onSelectionChange'function () {
                var feature = map.infoWindow.getSelectedFeature();
                if (feature !== undefined && map.infoWindow._toggleView) {
                    map.infoWindow._toggleView();
                }
            });
    });
}

Then just call somewhere this function to configure the behaviour before the user open some popup.

configurePopupMobileToMaximize(myMap);

Now, this uses a "private" function _toogleView() that we probably shouldn't use directly for some reason. Also, you probably should require the aspect module somewhere else (like a define block) and not inside the function. 

But it works.

View solution in original post

2 Replies
CarlosAugusto_Nantes_de_Castil
New Contributor III

A quick and dirty way of doing it, could be something like this:

function configurePopupMobileToMaximize (map) {
    require(['dojo/aspect'], function(aspect){
            aspect.after(map.infoWindow'onSelectionChange'function () {
                var feature = map.infoWindow.getSelectedFeature();
                if (feature !== undefined && map.infoWindow._toggleView) {
                    map.infoWindow._toggleView();
                }
            });
    });
}

Then just call somewhere this function to configure the behaviour before the user open some popup.

configurePopupMobileToMaximize(myMap);

Now, this uses a "private" function _toogleView() that we probably shouldn't use directly for some reason. Also, you probably should require the aspect module somewhere else (like a define block) and not inside the function. 

But it works.

View solution in original post

MaximeDemers
Occasional Contributor III

Nice and simple! Thank you Carlos for sharing this,

0 Kudos