arcgis hotkey在地图之外工作

时间:2018-05-29 03:46:38

标签: arcgis

在页面上制作地图:

function initMap() {
        return require([
                            "esri/map",
                            "esri/layers/ArcGISTiledMapServiceLayer",
                            "esri/layers/ArcGISDynamicMapServiceLayer",
                            "esri/layers/FeatureLayer",
                            "esri/graphic",
                            "esri/symbols/SimpleFillSymbol",
                            "esri/symbols/SimpleMarkerSymbol",
                            "esri/symbols/SimpleLineSymbol",
                            "esri/symbols/TextSymbol",
                            "esri/symbols/Font",
                            "esri/geometry/Circle",
                            "esri/geometry/Polygon",
                            "esri/geometry/Point",
                            "esri/SpatialReference",
                            "esri/geometry/webMercatorUtils",
                            "esri/layers/GraphicsLayer",
                            "dojo/request/script",
                            "dojo/_base/array",
                            "dojo/promise/all", "dojo/Deferred", "dojo/dom", "dojo/on", "dojo/json",
                            "esri/symbols/PictureMarkerSymbol",
                            "esri/symbols/CartographicLineSymbol",
                            "esri/geometry/Polyline",
                            "esri/Color",
                            "dojo/dom-construct",
                            "dojox/charting/Chart",
                            "dojo/domReady!"
        ],
        function (  Map, ArcGISTiledMapServiceLayer, ArcGISDynamicMapServiceLayer, FeatureLayer, Graphic, SimpleFillSymbol,
                    SimpleMarkerSymbol, SimpleLineSymbol, TextSymbol, Font, Circle, Polygon, Point, SpatialReference,
                    webMercatorUtils, GraphicsLayer, script, array, all, Deferred, dom, on, JSON, PictureMarkerSymbol, CartographicLineSymbol, Polyline, Color, domConstruct, Chart) {  // function parameters must be in the same order as requires

            map = new Map("map", {
                center: [99.999, 99.999],
                zoom: 12,
            });
            var mapServiceURL = "http://server.com/arcgis2/rest/services/Common/BASEMAP_BIPD/MapServer";
                map.addLayer(new esri.layers.ArcGISTiledMapServiceLayer(mapServiceURL));
           });
    }

它显示正确。使用地图在页面上制作相同的文本框。有时用户使用键盘右侧的数字键盘(靠近numlock)在文本框中写入任意数字,数字不是写入,但是地图是开始键盘导航。 Numlock处于数字状态。 这不是每一次。然后用户单击任何其他文本框并返回到此以继续写入编号 - 它正确写入。

如何修复或禁用arcgis热键?

(навсякий: подключаюкартунастраницу,нопринаборечиселнадопклавиатуревстороннемполенастраницефокусстоитнаэтомполе,нодвигаетсякарта,вместовводацифр(нумлоквправильномположении)。 Лечитсясменойфокусапоразнымполямнесколькораз。 Как-томожноотключитьхоткеи,илипочинитьтакоенездоровоеповедение?)

1 个答案:

答案 0 :(得分:0)

一种解决方案是在用户关注文本框时禁用地图键盘导航。然后,当焦点向外时,再次启用它。要完成此操作,请使用the docs中的这些功能:

map.enableKeyboardNavigation();
map.disableKeyboardNavigation();
map.isKeyboardNavigation;