Prevent eSearch from panning the map when searching by value.

624
6
Jump to solution
03-09-2018 08:12 AM
MartinOwens1
Occasional Contributor II

I noticed that if you are searching by a value in the eSearch unless the cursor is inside of the widget panel the numeric keys (except the digit 5) act as the directional pad and pans the map. Is there a way to disable this? I'm running WAB 2.5 and Enhanced Search 2.5.

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Martin,

  OK, here is the change. In the apps jimu/MapManager.js find the _show2DWebMap function and make this change below (line 9):

....
        var mapDeferred = this._createWebMapRaw(webMapPortalUrl, webMapItemId, this.mapDivId, webMapOptions);

        mapDeferred.then(lang.hitch(this, function(response) {
          var map = response.map;

          //hide the default zoom slider
          map.hideZoomSlider();
          map.disableKeyboardNavigation();
....

View solution in original post

0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Emeritus

Martin,

 That actually is just a feature in the JS api and is not related to eSearch. But if you really want some code changes to make to WAB to prevent this for the whole app then let me know.

0 Kudos
MartinOwens1
Occasional Contributor II

If it's too much trouble I'm not that worried about it. I had just noticed it, and thought it was weird. I'm assuming if it's code that is based on the JS api the only way to fix that would be to download, make changes, and then host the api locally instead of referencing the api through arcgis?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

No not at all, the API has a method/property that can be set to disable that on the map class.

0 Kudos
MartinOwens1
Occasional Contributor II

Oh, ok. Well in that case that would be great.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Martin,

  OK, here is the change. In the apps jimu/MapManager.js find the _show2DWebMap function and make this change below (line 9):

....
        var mapDeferred = this._createWebMapRaw(webMapPortalUrl, webMapItemId, this.mapDivId, webMapOptions);

        mapDeferred.then(lang.hitch(this, function(response) {
          var map = response.map;

          //hide the default zoom slider
          map.hideZoomSlider();
          map.disableKeyboardNavigation();
....
0 Kudos
MartinOwens1
Occasional Contributor II

Thanks Robert. That worked great!

0 Kudos