<?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 Re: view.hitTest returning 0 results in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443462#M40943</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i think i figured something out. &amp;nbsp;If i go to this link&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=visualization-location-simple"&gt;https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=visualization-location-simple&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and add this code at line 122&lt;/P&gt;&lt;P&gt;view.then(function(){&lt;BR /&gt; view.on("click", function(p){&lt;BR /&gt; alert(p.screenPoint.x);&lt;BR /&gt; view.hitTest(p.screenPoint).then( function(response){&lt;BR /&gt; alert(response.results.length);&lt;BR /&gt; });&lt;BR /&gt; });&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then i change the style to include a margin-top&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#viewDiv {&lt;BR /&gt; padding: 0;&lt;BR /&gt; margin-top: 100px;&lt;BR /&gt; height: 100%;&lt;BR /&gt; width: 100%;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It stops working. &amp;nbsp;i can click on just a green area and get 0, if i click directly on an orange dot i get 1. &amp;nbsp;If i do nothing but remove the margin-top and set it back to margin: 0; then if i click in any of the green area i get 1, if i click in the gray area i get 0 and clicking on any orange dot i get 2. &amp;nbsp;This is what i expect. &amp;nbsp;It looks like the hittest doesnt work if the map is not taking up the entire area?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Jan 2017 13:15:02 GMT</pubDate>
    <dc:creator>JasonRainwater</dc:creator>
    <dc:date>2017-01-27T13:15:02Z</dc:date>
    <item>
      <title>view.hitTest returning 0 results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443456#M40937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I am adding am empty feature layer on the fly in the browser.&amp;nbsp; After the fact I will add graphics to the source collection of the feature layer and my graphics all render correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I setup the mapView.on("click") and I properly get the event with the click data.&amp;nbsp; I do the hit test then look at the results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am physically clicking directly on the rendered graphic but no matter what the hittest shows 0 results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have no idea where to start looking to see what I am doing wrong.&amp;nbsp; Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jan 2017 18:30:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443456#M40937</guid>
      <dc:creator>JasonRainwater</dc:creator>
      <dc:date>2017-01-25T18:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: view.hitTest returning 0 results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443457#M40938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you able to reproduce the problem with this sample from the help?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=view-hittest" title="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=view-hittest"&gt;ArcGIS API for JavaScript Sandbox&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the problem specific to one particular browser? There is a known issue with version 4.2 and IE11 that will be fixed in the next release of the JSAPI. &amp;nbsp;Details here:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/188819-jsapi-v4-access-features-with-click-events-not-working-in-ie11"&gt;https://community.esri.com/thread/188819-jsapi-v4-access-features-with-click-events-not-working-in-ie11&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2017 18:22:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443457#M40938</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2017-01-26T18:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: view.hitTest returning 0 results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443458#M40939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No this is in chrome. Also when will that next version be released? I'm currently testing in chrome with no results but ie11 is our main supported browser.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2017 18:37:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443458#M40939</guid>
      <dc:creator>JasonRainwater</dc:creator>
      <dc:date>2017-01-26T18:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: view.hitTest returning 0 results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443459#M40940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you reproduce in Chrome with the sample I linked to above? Works just fine for me in the latest version of Chrome.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2017 18:40:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443459#M40940</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2017-01-26T18:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: view.hitTest returning 0 results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443460#M40941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes that works but I'm not pointing the feature layer to a url that hosts a server based feature layer.&amp;nbsp; I am creating an empty feature layer and then in javascript creating graphics objects with symbols and then adding them to the source collection of the feature layer.&amp;nbsp; Is there a sample that mimics that scenario?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2017 12:32:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443460#M40941</guid>
      <dc:creator>JasonRainwater</dc:creator>
      <dc:date>2017-01-27T12:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: view.hitTest returning 0 results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443461#M40942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried modifying code in several examples that use simplemarkersymbol and adding features as a collection of graphics but I could not find a sample that more closely matches my current situation.&amp;nbsp; I am creating an empty feature layer like so&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var featureLayer = new FeatureLayer({&lt;BR /&gt; fields: [&lt;BR /&gt; {&lt;BR /&gt; name: "ObjectID",&lt;BR /&gt; alias: "ObjectID",&lt;BR /&gt; type: "oid"&lt;BR /&gt; }&lt;BR /&gt; ],&lt;BR /&gt; id: "CustomPointLayer",&lt;BR /&gt; objectIdField: "ObjectID",&lt;BR /&gt; geometryType: "point",&lt;BR /&gt; spatialReference: spatialReference,&lt;BR /&gt; source: sourceCollection&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;this.customPointLayer = featureLayer;&lt;BR /&gt; this.customPointLayer.then(() =&amp;gt; {&lt;/P&gt;&lt;P&gt;defer.resolve();&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;localMap.add(this.customPointLayer);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then im adding a graphic like so&lt;/P&gt;&lt;P&gt;var circleProperties: __esri.SimpleMarkerSymbolProperties = {&lt;BR /&gt; size: 40,&lt;BR /&gt; color: new Color("red"),&lt;BR /&gt; outline: {&lt;BR /&gt; color: new Color([255, 255, 255]),&lt;BR /&gt; width: 0&lt;BR /&gt; }&lt;BR /&gt; };&lt;/P&gt;&lt;P&gt;var circleSymbol = new SimpleMarkerSymbol(circleProperties);&lt;/P&gt;&lt;P&gt;var circleGraphic = new Graphic();&lt;BR /&gt; circleGraphic.geometry = point;&lt;BR /&gt; circleGraphic.symbol = circleSymbol;&lt;BR /&gt; circleGraphic.attributes = {&lt;BR /&gt; ObjectID: this.guidService.newGuid(),&lt;BR /&gt; recordsIds: clusterSymbolType.recordIds&lt;BR /&gt; }&lt;BR /&gt; customPointLayer.source.add(circleGraphic);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then add a textsymbol on top of it like so&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var countProperties: __esri.TextSymbolProperties = {&lt;BR /&gt; color: new Color("white"),&lt;BR /&gt; yoffset: -5,&lt;BR /&gt; text: count.toString(),&lt;BR /&gt; font: { // autocast as esri/symbols/Font&lt;BR /&gt; size: "20px",&lt;BR /&gt; family: "roboto",&lt;BR /&gt; weight: "400"&lt;BR /&gt; }&lt;BR /&gt; };&lt;/P&gt;&lt;P&gt;var countSymbol = new TextSymbol(countProperties);&lt;/P&gt;&lt;P&gt;var countGraphic = new Graphic();&lt;BR /&gt; countGraphic.geometry = point;&lt;BR /&gt; countGraphic.symbol = countSymbol;&lt;BR /&gt; countGraphic.attributes = {&lt;BR /&gt; ObjectID: this.guidService.newGuid(),&lt;BR /&gt; recordsIds: clusterSymbolType.recordIds&lt;BR /&gt; };&lt;/P&gt;&lt;P&gt;customPointLayer.source.add(countGraphic);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;im then listening like so&lt;/P&gt;&lt;P&gt;this.mapView.then(() =&amp;gt; {&lt;BR /&gt; this.mapView.on("click",&lt;BR /&gt; (p) =&amp;gt; {&lt;BR /&gt; this.mapView.hitTest(p.screenPoint)&lt;BR /&gt; .then(response =&amp;gt; {&lt;BR /&gt; // do something with the result graphic&lt;BR /&gt; var graphic = response.results[0].graphic;&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;});&lt;BR /&gt; this.mapViewDefer.resolve();&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However no matter which browser the hitTest returns 0 length for the results property&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2017 13:01:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443461#M40942</guid>
      <dc:creator>JasonRainwater</dc:creator>
      <dc:date>2017-01-27T13:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: view.hitTest returning 0 results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443462#M40943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i think i figured something out. &amp;nbsp;If i go to this link&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=visualization-location-simple"&gt;https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=visualization-location-simple&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and add this code at line 122&lt;/P&gt;&lt;P&gt;view.then(function(){&lt;BR /&gt; view.on("click", function(p){&lt;BR /&gt; alert(p.screenPoint.x);&lt;BR /&gt; view.hitTest(p.screenPoint).then( function(response){&lt;BR /&gt; alert(response.results.length);&lt;BR /&gt; });&lt;BR /&gt; });&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then i change the style to include a margin-top&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#viewDiv {&lt;BR /&gt; padding: 0;&lt;BR /&gt; margin-top: 100px;&lt;BR /&gt; height: 100%;&lt;BR /&gt; width: 100%;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It stops working. &amp;nbsp;i can click on just a green area and get 0, if i click directly on an orange dot i get 1. &amp;nbsp;If i do nothing but remove the margin-top and set it back to margin: 0; then if i click in any of the green area i get 1, if i click in the gray area i get 0 and clicking on any orange dot i get 2. &amp;nbsp;This is what i expect. &amp;nbsp;It looks like the hittest doesnt work if the map is not taking up the entire area?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2017 13:15:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443462#M40943</guid>
      <dc:creator>JasonRainwater</dc:creator>
      <dc:date>2017-01-27T13:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: view.hitTest returning 0 results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443463#M40944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got something working but i have a feeling the code will break with the next upgrade if it fixes the problem. &amp;nbsp;I get my graphics properly when i do this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_this.mapView.on("click", function (p) {&lt;BR /&gt; var boundingRect = _this.mapElement[0].getBoundingClientRect();&lt;BR /&gt; var point = {&lt;BR /&gt; x: p.screenPoint.x + boundingRect.left,&lt;BR /&gt; y: p.screenPoint.y + boundingRect.top&lt;BR /&gt; };&lt;BR /&gt; _this.mapView.hitTest(point)&lt;BR /&gt; .then(function (response) {&lt;BR /&gt; // do something with the result graphic&lt;BR /&gt; var graphic = response.results[0].graphic;&lt;BR /&gt; });&lt;BR /&gt; });&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2017 15:45:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443463#M40944</guid>
      <dc:creator>JasonRainwater</dc:creator>
      <dc:date>2017-01-27T15:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: view.hitTest returning 0 results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443464#M40945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi kelly, is there any update on when a version will be available on the ie11 fix? &amp;nbsp;We can work around the all browsers issue with what i have below but ie is critical for us&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jan 2017 17:33:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443464#M40945</guid>
      <dc:creator>JasonRainwater</dc:creator>
      <dc:date>2017-01-30T17:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: view.hitTest returning 0 results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443465#M40946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jason I'm not sure that the issue is the same one you are experiencing - you may want to contact Esri support to setup a test case. &amp;nbsp;The other issue will be fixed in the next release which is scheduled for the March time frame.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jan 2017 18:21:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443465#M40946</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2017-01-30T18:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: view.hitTest returning 0 results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443466#M40947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thats fine, i have a workaround for the issue in this item. &amp;nbsp;Ill open up a test case for it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2017 12:27:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443466#M40947</guid>
      <dc:creator>JasonRainwater</dc:creator>
      <dc:date>2017-01-31T12:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: view.hitTest returning 0 results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443467#M40948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jason,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was trying to do the same thing a couple of weeks ago and after several attempts, stopped trying to use a feature layer and instead just used graphics. &amp;nbsp;Like you, I was not using a service, I could see the graphics, but could not click on them. &amp;nbsp;I also tried a hit test and got an empty result. &amp;nbsp;I started to suspect a problem with the mouse click needing to be extremely precise. &amp;nbsp;I never figured out the cause of the problem but would be interested to know how your case ends up. &amp;nbsp;Here is the thread for my issue:&amp;nbsp;&lt;A href="https://community.esri.com/thread/188561"&gt;PopupTemplate from Client Side Graphics Not Working&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Chuck&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2017 17:10:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443467#M40948</guid>
      <dc:creator>chuckfrank</dc:creator>
      <dc:date>2017-01-31T17:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: view.hitTest returning 0 results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443468#M40949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Chuck, if you look at one of my later responses above you can see what i had to do in order to make it work. &amp;nbsp;apparently hitTest only works if the map is taking up the entire screen. &amp;nbsp;I had to adjust the point it hittest against relative to the distance from the top and left of the map element and it started working. &amp;nbsp;Still doesnt work in ie11 or edge but at least we know now there is an all browser bug against how the hittest is calculated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2017 17:43:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443468#M40949</guid>
      <dc:creator>JasonRainwater</dc:creator>
      <dc:date>2017-01-31T17:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: view.hitTest returning 0 results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443469#M40950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I looked at the link you provide. &amp;nbsp;What seems like would cause it to stop working is if you set something like a margin-top 50px. &amp;nbsp;I am pretty sure your working example would stop working if you do that. &amp;nbsp;It only works because you have margin 0 and height/width 100%&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2017 18:06:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443469#M40950</guid>
      <dc:creator>JasonRainwater</dc:creator>
      <dc:date>2017-01-31T18:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: view.hitTest returning 0 results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443470#M40951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jason, if you check this post you can see a couple examples of how we're returning a selction grahic and poup results from our feature layes using the hitTest method:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/183372-jsapi-40-popup-set-highlight-graphic-on-feature-layer-click"&gt;https://community.esri.com/thread/183372-jsapi-40-popup-set-highlight-graphic-on-feature-layer-click&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2017 20:26:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443470#M40951</guid>
      <dc:creator>DavidColey</dc:creator>
      <dc:date>2017-01-31T20:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: view.hitTest returning 0 results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443471#M40952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David, if you look at what I've posted above you'll see that hittest only works if the map takes up the full window. I would bet that if you took your working code and added a margin-top 50px on the div hosting the map your hittest will stop working. Above I was able to demonstrate this by slightly modifying the code so that the map div did not take up the full screen (in the samples case it's an i frame and the sample takes up full size of the iframe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2017 20:33:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443471#M40952</guid>
      <dc:creator>JasonRainwater</dc:creator>
      <dc:date>2017-01-31T20:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: view.hitTest returning 0 results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443472#M40953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jason, ok I now see your issue and how you are having to account for that offset. &amp;nbsp;I am using the calcite map bootstrap 4.x template for all of our api apps and so am not adding any margin or padding. Of course, the real fix for this lies with ESRI and upgrading the popup's widget code to handle selection graphics and paging . . .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2017 21:46:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443472#M40953</guid>
      <dc:creator>DavidColey</dc:creator>
      <dc:date>2017-01-31T21:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: view.hitTest returning 0 results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443473#M40954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was facing similiar problem. I used the code from the example and it didn't work. The problem was that when view.on("click", function(evt){...}) was fired, it was trying to store properties x and y of object env into variable screenPoint. But there were no properties like this, so the x, y in screenPoint was 'undefined'. But object env has a whole property&amp;nbsp;screenPoint, which already holds the x, y values.&lt;/P&gt;&lt;P&gt;So if&amp;nbsp;you keep getting returned empty results, try to check if the properties are in the object. If not, then you can easily replace this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;var &lt;/SPAN&gt;screenPoint = {
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #9876aa;"&gt;x&lt;/SPAN&gt;: evt.&lt;SPAN style="color: #9876aa;"&gt;x&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #9876aa;"&gt;y&lt;/SPAN&gt;: evt.&lt;SPAN style="color: #9876aa;"&gt;y
&lt;/SPAN&gt;}&lt;SPAN style="color: #cc7832;"&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;var &lt;/SPAN&gt;screenPoint = evt.screenPoint&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:50:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443473#M40954</guid>
      <dc:creator>OliverTylšar</dc:creator>
      <dc:date>2021-12-11T19:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: view.hitTest returning 0 results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443474#M40955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another common issue happens when the view container is not 100% of the width and height of the body node. &amp;nbsp;In these cases I normally adjust the event screenPoint by the view position:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;evt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;screenPoint&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;x &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; view&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;position&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
evt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;screenPoint&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;y &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; view&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;position&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:50:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443474#M40955</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2021-12-11T19:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: view.hitTest returning 0 results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443475#M40956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like this is still an issue with ArcGIS API for JavaScript 4.15. Still can't return results with hitTest on client-side graphics in a Feature Layer, or view popups.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2020 13:50:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/view-hittest-returning-0-results/m-p/443475#M40956</guid>
      <dc:creator>KevinCheriyan</dc:creator>
      <dc:date>2020-05-04T13:50:17Z</dc:date>
    </item>
  </channel>
</rss>

