laptop and a wrench

漏洞

The disableDoubleClickZoom function is overridden when using the Draw toolbar. When trying to implement the disableDoubleClickZoom function, it does not work for some tools from the Draw toolbar such as Multipoint, polyline and polygon.

上次发布: May 6, 2019 No Product Found
漏洞 ID 编号 NIM065568
已提交February 28, 2011
上次修改时间June 5, 2024
适用范围No Product Found
找到的版本2.1
状态Will Not Be Addressed

附加信息

There are no plans to address this issue for an unsupported version.

解决办法

If the line of code map.disableDoubleClickZoom(); is again in the code after the graphics are added, the DoubleClickZoom property remains false for all the tools in the Draw toolbar

Sample code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "<a href="http://www.w3.org/TR/html4/strict.dtd" target="_blank">http://www.w3.org/TR/html4/strict.dtd</a>">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

<meta http-equiv="X-UA-Compatible" content="IE=7" />

<meta name="viewport" content="width=device-width,user-scalable=no"/>

<!--The viewport meta tag is used to improve the presentation and behavior of the samples

on iOS devices-->

<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>

<title>Maps Toolbar</title>

<link rel="stylesheet" type="text/css" href="<a href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.1/js/dojo/dijit/themes/claro/claro.css" target="_blank">http://serverapi.arcgisonline.com/jsapi/arcgis/2.1/js/dojo/dijit/themes/claro/claro.css</a>">

<style type="text/css">

html, body {

height: 100%; width: 100%; margin: 0; padding: 0;

}

</style>

<script type="text/javascript">

djConfig = {

parseOnLoad: true

}

</script>

<script type="text/javascript" src="<a href="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.1" target="_blank">http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.1</a>"></script>

<script type="text/javascript">

dojo.require("esri.map");

dojo.require("esri.toolbars.draw");

dojo.require("dijit.dijit"); // optimize: load dijit layer

dojo.require("dijit.layout.BorderContainer");

dojo.require("dijit.layout.ContentPane");

var map, toolbar, symbol, geomTask;

function init() {

var startExtent = new esri.geometry.Extent({"xmin":-11721159.665358918,"ymin":-1138850.8106919006,"xmax":8277212.918942982,"ymax":9858297.322750043,"spatialReference":{"wkid":102100}});

map = new esri.Map("map",{extent:startExtent});

dojo.connect(map, "onLoad", createToolbar);

var basemap = new esri.layers.ArcGISTiledMapServiceLayer("<a href="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" target="_blank">http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer</a>");

map.addLayer(basemap);

}

function createToolbar(map) {

toolbar = new esri.toolbars.Draw(map);

dojo.connect(toolbar, "onDrawEnd", addToMap);

map.disableDoubleClickZoom();

alert("The value of property Double Click Zoom on map load is "+ map.isDoubleClickZoom);

}

function addToMap(geometry) {

toolbar.deactivate();

//alert("Using toolbar the value of Double click zoom now is "+ map.isDoubleClickZoom );

map.showZoomSlider();

switch (geometry.type) {

case "point":

var symbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE, 10, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]), 1), new dojo.Color([0,255,0,0.25]));

break;

case "polyline":

var symbol = new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASH, new dojo.Color([255,0,0]), 1);

break;

case "polygon":

var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASHDOT, new dojo.Color([255,0,0]), 2), new dojo.Color([255,255,0,0.25]));

break;

case "extent":

var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASHDOT, new dojo.Color([255,0,0]), 2), new dojo.Color([255,255,0,0.25]));

break;

case "multipoint":

var symbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_DIAMOND, 20, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0,0,0]), 1), new dojo.Color([255,255,0,0.5]));

break;

}

var graphic = new esri.Graphic(geometry, symbol);

map.graphics.add(graphic);

map.disableDoubleClickZoom();

alert("Using toolbar the value of Double click zoom now is "+ map.isDoubleClickZoom );

}

dojo.addOnLoad(init);

</script>

</head>

<body class="claro">

<div id="mainWindow" dojotype="dijit.layout.BorderContainer" design="headline" gutters="false" style="width:100%; height:100%;">

<div id="header" dojotype="dijit.layout.ContentPane" region="top" style="height:70px;text-align:left;font-weight:bold;font-size:14px;color:#400D12;">

<span>Draw:<br /></span>

<button dojoType="dijit.form.Button" onClick="toolbar.activate(esri.toolbars.Draw.POINT);map.hideZoomSlider();">Point</button>

<button dojoType="dijit.form.Button" onClick="toolbar.activate(esri.toolbars.Draw.MULTI_POINT);map.hideZoomSlider();">Multipoint</button>

<button dojoType="dijit.form.Button" onClick="toolbar.activate(esri.toolbars.Draw.LINE);map.hideZoomSlider();">Line</button>

<button dojoType="dijit.form.Button" onClick="toolbar.activate(esri.toolbars.Draw.POLYLINE);map.hideZoomSlider();">Polyline</button>

<button dojoType="dijit.form.Button" onClick="toolbar.activate(esri.toolbars.Draw.POLYGON);map.hideZoomSlider();">Polygon</button>

<button dojoType="dijit.form.Button" onClick="toolbar.activate(esri.toolbars.Draw.FREEHAND_POLYLINE);map.hideZoomSlider();">Freehand Polyline</button>

<button dojoType="dijit.form.Button" onClick="toolbar.activate(esri.toolbars.Draw.FREEHAND_POLYGON);map.hideZoomSlider();">Freehand Polygon</button>

<!--The Arrow,Triangle,Circle and Ellipse types all draw with the polygon symbol-->

<button dojoType="dijit.form.Button" onClick="toolbar.activate(esri.toolbars.Draw.ARROW);map.hideZoomSlider();">Arrow</button>

<button dojoType="dijit.form.Button" onClick="toolbar.activate(esri.toolbars.Draw.TRIANGLE);map.hideZoomSlider();">Triangle</button>

<button dojoType="dijit.form.Button" onClick="toolbar.activate(esri.toolbars.Draw.CIRCLE);map.hideZoomSlider();">Circle</button>

<button dojoType="dijit.form.Button" onClick="toolbar.activate(esri.toolbars.Draw.ELLIPSE);map.hideZoomSlider();">Ellipse</button>

</div>

<div id="map" dojoType="dijit.layout.ContentPane" style="border:solid 2px #587498;margin:5px;" region="center">

</div>

</div>

</body>

</html>

重现步骤

漏洞 ID: NIM065568

软件:

  • No Product Found

当漏洞状态发生变化时获得通知

下载 Esri 支持应用程序

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项