change on-screen icon placeholder size

391
3
Jump to solution
10-03-2019 09:52 AM
HelenZhou
Occasional Contributor II

In WAB application at version 2.13, I would like to change the icon's place holder size of an Off-panel, on-screen widget. How do I do? thanks for any help.

Helen

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Helen,

You are right in 2.13 it has changed to BaseLayoutManager.js in the jimu.js folder (lines 21 and 22).

_createOnScreenWidgetIcon: function(widgetConfig){
      var iconDijit = new OnScreenWidgetIcon({
        panelManager: this.panelManager,
        widgetManager: this.widgetManager,
        widgetConfig: widgetConfig,
        configId: widgetConfig.id,
        map: this.map
      });

      if(widgetConfig.position.relativeTo === 'map'){
        html.place(iconDijit.domNode, this.mapId);
      }else{
        html.place(iconDijit.domNode, this.layoutId);
      }
      //icon position doesn't use width/height in config
      html.setStyle(iconDijit.domNode, jimuUtils.getPositionStyle({
        top: widgetConfig.position.top,
        left: widgetConfig.position.left,
        right: widgetConfig.position.right,
        bottom: widgetConfig.position.bottom,
        width: 40,
        height: 40
      }));
      iconDijit.startup();

      if(!this.openAtStartWidget && widgetConfig.openAtStart){
        iconDijit.switchToOpen();
        this.openAtStartWidget = widgetConfig.name;
      }

      this.onScreenWidgetIcons.push(iconDijit);
      return iconDijit;
    },

View solution in original post

0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus

I believe this is the thraed you are looking for then:

https://community.esri.com/thread/171233 

0 Kudos
HelenZhou
Occasional Contributor II

Thanks Robert. I have read the thread, It looks like the code has been changed at version 2.13. I am not able to see the correspondent codes. I have changed jimu-widget-onscreen-icon in \jimu.js\css\jimu.css. It doesn't work. Do you have any idea?

Thanks

Helen

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Helen,

You are right in 2.13 it has changed to BaseLayoutManager.js in the jimu.js folder (lines 21 and 22).

_createOnScreenWidgetIcon: function(widgetConfig){
      var iconDijit = new OnScreenWidgetIcon({
        panelManager: this.panelManager,
        widgetManager: this.widgetManager,
        widgetConfig: widgetConfig,
        configId: widgetConfig.id,
        map: this.map
      });

      if(widgetConfig.position.relativeTo === 'map'){
        html.place(iconDijit.domNode, this.mapId);
      }else{
        html.place(iconDijit.domNode, this.layoutId);
      }
      //icon position doesn't use width/height in config
      html.setStyle(iconDijit.domNode, jimuUtils.getPositionStyle({
        top: widgetConfig.position.top,
        left: widgetConfig.position.left,
        right: widgetConfig.position.right,
        bottom: widgetConfig.position.bottom,
        width: 40,
        height: 40
      }));
      iconDijit.startup();

      if(!this.openAtStartWidget && widgetConfig.openAtStart){
        iconDijit.switchToOpen();
        this.openAtStartWidget = widgetConfig.name;
      }

      this.onScreenWidgetIcons.push(iconDijit);
      return iconDijit;
    },
0 Kudos