Is there a way to maximize PopupMobile automatically?

786
2
Jump to solution
09-28-2016 07:54 AM
FlavieMORAUX1
Occasional Contributor

In webapp (developer) in mobiel mode PopupMobile opens but minimized.

I want the PopupMobile opens and maximize automatically. 

API does not provide a methode to maximize, only to :

  • show ==> in order to open but mimimized
  • hide ==> in order to close.

Do you have an idea to do this?

Thanks,

Flavie

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

Flavie,

  Sure in the MapManager.js find the resetInfoWindow function and have the following changes (lines 15 - 22):

      resetInfoWindow: function(isNewMap) {
        if(isNewMap){
          this._mapInfoWindow = this.map.infoWindow;
          if(this._mapMobileInfoWindow){
            this._mapMobileInfoWindow.destroy();
          }
          this._mapMobileInfoWindow =
          new PopupMobile(null, html.create("div", null, null, this.map.root));
          this.isMobileInfoWindow = false;
        }
        if (window.appInfo.isRunInMobile && !this.isMobileInfoWindow) {
          this.map.infoWindow.hide();
          this.map.setInfoWindow(this._mapMobileInfoWindow);
          this.isMobileInfoWindow = true;
          this._mapMobileInfoWindow.on("show", lang.hitch(this, function(){
              require(['dojo/query'], function(query) {
                //Maximize popup
                html.setStyle(query(".esriPopupMobile")[0], "display", "none");
                html.setStyle(query(".esriMobileNavigationBar")[0], "display", "block");
                html.setStyle(query(".esriMobileInfoView.esriMobilePopupInfoView")[0], "display", "block");
              });
          }));

View solution in original post

2 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Flavie,

  Sure in the MapManager.js find the resetInfoWindow function and have the following changes (lines 15 - 22):

      resetInfoWindow: function(isNewMap) {
        if(isNewMap){
          this._mapInfoWindow = this.map.infoWindow;
          if(this._mapMobileInfoWindow){
            this._mapMobileInfoWindow.destroy();
          }
          this._mapMobileInfoWindow =
          new PopupMobile(null, html.create("div", null, null, this.map.root));
          this.isMobileInfoWindow = false;
        }
        if (window.appInfo.isRunInMobile && !this.isMobileInfoWindow) {
          this.map.infoWindow.hide();
          this.map.setInfoWindow(this._mapMobileInfoWindow);
          this.isMobileInfoWindow = true;
          this._mapMobileInfoWindow.on("show", lang.hitch(this, function(){
              require(['dojo/query'], function(query) {
                //Maximize popup
                html.setStyle(query(".esriPopupMobile")[0], "display", "none");
                html.setStyle(query(".esriMobileNavigationBar")[0], "display", "block");
                html.setStyle(query(".esriMobileInfoView.esriMobilePopupInfoView")[0], "display", "block");
              });
          }));
FlavieMORAUX1
Occasional Contributor

Great! 

But just a little problem with minimize button. After clicking on this button, PopupMobile never appears.

For my needs I can hide this button, so no worries.

.esriMobileNavigationBar .esriMobileNavigationItem.right {
display: none !important;
}

Thank you Robert! 

0 Kudos