new Navigation object throwing error

833
1
Jump to solution
08-11-2013 09:37 AM
NigelAlford
New Contributor III
whenever I'm instantiating a new Navigation object I'm getting an error:
Cannot read property 'query' of null 


upon inspection of the objects everything looks correct but it fails every time.  Has anyone else experienced this?

I'm using ArcGIS js version 3.6

Here's my instantiation call:
require(['esri/map', 'esri/layers/ArcGISTiledMapServiceLayer', 'esri/layers/ArcGISDynamicMapServiceLayer', 'esri/symbols/PictureMarkerSymbol', 'esri/renderers/SimpleRenderer', 'esri/toolbars/navigation', 'esri/dijit/Scalebar'], function(Map, ArcGISTiledMapServiceLayer, Navigation, Scalebar) {       nsmap.map = new Map(mapID, {         basemap: 'gray', //valid options: "streets" , "satellite" , "hybrid", "topo", "gray", "osm"         center: [-84.858, 37.388],         zoom: initLevel,         lods: lod,         slider: false       });        nsmap.nav = new Navigation(nsmap.map);      });


Thanks
0 Kudos
1 Solution

Accepted Solutions
VinayBansal
Occasional Contributor II
Your require classes does not match with the function arguments order......
require([  "esri/toolbars/Navigation", "dijit/registry", ...  ], function( Navigation, registry, ... ) {


Order must be followed when creating a function with require. Your navigation object is taking reference of 'esri/layers/ArcGISDynamicMapServiceLayer'

View solution in original post

1 Reply
VinayBansal
Occasional Contributor II
Your require classes does not match with the function arguments order......
require([  "esri/toolbars/Navigation", "dijit/registry", ...  ], function( Navigation, registry, ... ) {


Order must be followed when creating a function with require. Your navigation object is taking reference of 'esri/layers/ArcGISDynamicMapServiceLayer'