<?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: Getting &amp;quot;cannot read property id of 'null' error when creating a Query() in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-quot-cannot-read-property-id-of-null-error/m-p/546860#M50955</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like your argument aliases are not in the same order ad the modules. In your code you load esri/tasks/query as the&amp;nbsp; 6th module in the list but the associated alias is 4th. So when you use Query in your code you are really referring to Color which is the 4th module. If you rearrange your modules so they match the order of the argument name your code should work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14460729168496972 jive_text_macro" data-renderedposition="113_8_912_16" jivemacro_uid="_14460729168496972"&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp; require([&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp; 'dojo/dom',&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp; 'dojo/on',&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp; 'dojo/_base/array',&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp; 'dojo/_base/Color',&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp; 'esri/map',&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp; 'esri/tasks/query',&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp; 'esri/tasks/QueryTask',&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp; 'esri/symbols/SimpleMarkerSymbol',&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp; 'esri/symbols/SimpleLineSymbol',&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp; 'esri/graphic'], function(dom, on, array, Query, QueryTask, Map, Color, SimpleMarkerSymbol, SimpleLineSymbol, Graphic){&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Oct 2015 22:56:26 GMT</pubDate>
    <dc:creator>KellyHutchins</dc:creator>
    <dc:date>2015-10-28T22:56:26Z</dc:date>
    <item>
      <title>Getting "cannot read property id of 'null' error when creating a Query()</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-quot-cannot-read-property-id-of-null-error/m-p/546858#M50953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to work through a simple tutorial and whenever I get to the "var query = new Query();" line I get an error in chrome in init.js and cannot read id of null. Supposedly the error is on line 143 of init.js in b.get. I get the same error running locally with simpleHTTPServer or from cloud9. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**Code below in its entirety&lt;/P&gt;&lt;P&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;html&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;head&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;link rel="stylesheet" href="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fjs.arcgis.com%2F3.14%2Fesri%2Fcss%2Fesri.css" rel="nofollow" target="_blank"&gt;http://js.arcgis.com/3.14/esri/css/esri.css&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/head&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;body&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;select id="population" name="population"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;option value="" selected="selected"&amp;gt;Select a population&amp;lt;/option&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;option value="2500"&amp;gt;2,500&amp;lt;/option&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;option value="5000"&amp;gt;5,000&amp;lt;/option&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;option value="7500"&amp;gt;7,500&amp;lt;/option&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/select&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;div id="map"&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/body&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;script src="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fjs.arcgis.com%2F3.14%2F" rel="nofollow" target="_blank"&gt;http://js.arcgis.com/3.14/&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; require([&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'dojo/dom',&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'dojo/on',&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'dojo/_base/array',&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'dojo/_base/Color',&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'esri/map',&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'esri/tasks/query',&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'esri/tasks/QueryTask',&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'esri/symbols/SimpleMarkerSymbol',&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'esri/symbols/SimpleLineSymbol',&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'esri/graphic'], function(dom, on, array, Query, QueryTask, Map, Color, SimpleMarkerSymbol, SimpleLineSymbol, Graphic){&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var map = new Map('map', {&lt;/P&gt;&lt;P&gt;&amp;nbsp; basemap: 'streets',&lt;/P&gt;&lt;P&gt;&amp;nbsp; center: [-118.2095, 34.0866],&lt;/P&gt;&lt;P&gt;&amp;nbsp; zoom: 10&lt;/P&gt;&lt;P&gt;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; var url = '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fservices.arcgis.com%2FV6ZHFr6zdgNZuVG0%2Farcgis%2Frest%2Fservices%2Fla_county_labor_centroid%2FFeatureServer%2F0%27%3B" rel="nofollow" target="_blank"&gt;http://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/la_county_labor_centroid/FeatureServer/0';&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var markerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_SQUARE, 10, null, new Color([50,50,255]));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; function onQuerySuccess(featureSet) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.graphics.clear();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array.forEach(featureSet.features, function(feature){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; feature.setSymbol(markerSymbol);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.graphics.add(feature);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; function onError(error){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.error('An eerror occurred in the query: ', error);&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; on(dom.byId('population'), 'change', function(e) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var population = e.target.value;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (population.length &amp;gt; 0) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var queryTask = new QueryTask(url);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var query = new Query();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.where = 'TOTAL_POP &amp;gt; ' + population;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.returnGeometry = true;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask.execute(query).then(onQuerySuccess, onError);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/html&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Oct 2015 21:47:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-quot-cannot-read-property-id-of-null-error/m-p/546858#M50953</guid>
      <dc:creator>KenPierce</dc:creator>
      <dc:date>2015-10-28T21:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: Getting "cannot read property id of 'null' error when creating a Query()</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-quot-cannot-read-property-id-of-null-error/m-p/546859#M50954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ken,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What tutorial are you trying?&amp;nbsp; What are you trying to accomplish with this webapp? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Oct 2015 22:18:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-quot-cannot-read-property-id-of-null-error/m-p/546859#M50954</guid>
      <dc:creator>RickeyFight</dc:creator>
      <dc:date>2015-10-28T22:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: Getting "cannot read property id of 'null' error when creating a Query()</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-quot-cannot-read-property-id-of-null-error/m-p/546860#M50955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like your argument aliases are not in the same order ad the modules. In your code you load esri/tasks/query as the&amp;nbsp; 6th module in the list but the associated alias is 4th. So when you use Query in your code you are really referring to Color which is the 4th module. If you rearrange your modules so they match the order of the argument name your code should work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14460729168496972 jive_text_macro" data-renderedposition="113_8_912_16" jivemacro_uid="_14460729168496972"&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp; require([&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp; 'dojo/dom',&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp; 'dojo/on',&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp; 'dojo/_base/array',&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp; 'dojo/_base/Color',&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp; 'esri/map',&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp; 'esri/tasks/query',&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp; 'esri/tasks/QueryTask',&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp; 'esri/symbols/SimpleMarkerSymbol',&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp; 'esri/symbols/SimpleLineSymbol',&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp; 'esri/graphic'], function(dom, on, array, Query, QueryTask, Map, Color, SimpleMarkerSymbol, SimpleLineSymbol, Graphic){&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Oct 2015 22:56:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-quot-cannot-read-property-id-of-null-error/m-p/546860#M50955</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2015-10-28T22:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: Getting "cannot read property id of 'null' error when creating a Query()</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-quot-cannot-read-property-id-of-null-error/m-p/546861#M50956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow. I had no idea the order mattered in an an anonymous function call. I guess it makes sense. I'm thinking in terms of imports and arbitrary objects passed as parameters. Not sure how I hadn't come across that before. Thanks!!! Oh, the anonymous function is part of the require function call. I've been doing Node and angular lately. Can't let similar function names make me complacent. The tutorial is the Manning book ArcGIS Web Development. The mistake was mine not the books. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Oct 2015 23:20:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-quot-cannot-read-property-id-of-null-error/m-p/546861#M50956</guid>
      <dc:creator>KenPierce</dc:creator>
      <dc:date>2015-10-28T23:20:24Z</dc:date>
    </item>
  </channel>
</rss>

