<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Disable zoom only when a valid hitTest target found in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/disable-zoom-only-when-a-valid-hittest-target/m-p/1068817#M73513</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;Is there a way to disable double click zoom, only when a hitTest target has been found ?&lt;/P&gt;&lt;P&gt;I have tried&amp;nbsp; many ways, as to clone event and then dispatch it in case no hitest is found, or use emit.&lt;/P&gt;&lt;P&gt;But no solution for instance ! Something like view.emit( "double-click", evtCopy ) does nothing.&lt;/P&gt;&lt;P&gt;e.g. :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;view.on("double-click", function(evt)
{
	const opts = {
		include: [layer1, layer2]
	};
	//evt.stopPropagation();// Disable double-click zoom works but disables ALL cases
	view.hitTest(evt, opts).then(function(response)
	{
		if( response.results.length )// check if a feature is returned from one of the aimed layers
		{
			evt.stopPropagation();// This do not work as it is too late
			const graphic0 = response.results[0].graphic;
			processTarget(graphic0);
		}
		else
			evt.native.target.dispatchEvent( evt.native );// if not valid target, trigger regular dbl-click events anyway: not working
	});
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
    <pubDate>Tue, 20 Jul 2021 09:02:07 GMT</pubDate>
    <dc:creator>ChristopheS</dc:creator>
    <dc:date>2021-07-20T09:02:07Z</dc:date>
    <item>
      <title>Disable zoom only when a valid hitTest target found</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/disable-zoom-only-when-a-valid-hittest-target/m-p/1068817#M73513</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;Is there a way to disable double click zoom, only when a hitTest target has been found ?&lt;/P&gt;&lt;P&gt;I have tried&amp;nbsp; many ways, as to clone event and then dispatch it in case no hitest is found, or use emit.&lt;/P&gt;&lt;P&gt;But no solution for instance ! Something like view.emit( "double-click", evtCopy ) does nothing.&lt;/P&gt;&lt;P&gt;e.g. :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;view.on("double-click", function(evt)
{
	const opts = {
		include: [layer1, layer2]
	};
	//evt.stopPropagation();// Disable double-click zoom works but disables ALL cases
	view.hitTest(evt, opts).then(function(response)
	{
		if( response.results.length )// check if a feature is returned from one of the aimed layers
		{
			evt.stopPropagation();// This do not work as it is too late
			const graphic0 = response.results[0].graphic;
			processTarget(graphic0);
		}
		else
			evt.native.target.dispatchEvent( evt.native );// if not valid target, trigger regular dbl-click events anyway: not working
	});
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 09:02:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/disable-zoom-only-when-a-valid-hittest-target/m-p/1068817#M73513</guid>
      <dc:creator>ChristopheS</dc:creator>
      <dc:date>2021-07-20T09:02:07Z</dc:date>
    </item>
  </channel>
</rss>

