basemaps error

1249
10
11-20-2012 11:12 AM
CraigMcDade
Occasional Contributor III
Started seeing the following error in my basemaps gallery today:

TypeError: Unable to get value of the property '_basemapGalleryLayerType': object is null or undefined

Using standard code from the samples. Any thoughts on where I can look. It had been working up until now.
0 Kudos
10 Replies
KellyHutchins
Esri Frequent Contributor
I'm not seeing this with the samples:

http://help.arcgis.com/en/webapi/javascript/arcgis/samples/widget_basemap/index.html

Can you provide sample code that demonstrates the problem?
0 Kudos
CraigMcDade
Occasional Contributor III
Hi Kelly,

You can view the error using the attachment that I posted on this thread. As far as I can tell the code is the exact same as the samples.
0 Kudos
KellyHutchins
Esri Frequent Contributor
When I run your app with Firebug enabled I see 'Aborted' errors due to this layer. Do you have an updated version of the app?

http://www.gisprod2.com/ArcGIS/rest/services/Dynamic/Zoning/MapServer?f=json&dpi=96&transparent=true...
0 Kudos
CraigMcDade
Occasional Contributor III
When I run your app with Firebug enabled I see 'Aborted' errors due to this layer. Do you have an updated version of the app?

http://www.gisprod2.com/ArcGIS/rest/services/Dynamic/Zoning/MapServer?f=json&dpi=96&transparent=true...


I have attached the most recent version of the app. The only difference between the two is that I inserted a hide/show of the datagrid.

Thanks for your help.
0 Kudos
KellyHutchins
Esri Frequent Contributor
In your app it looks like you setup the listener for the maps onLoad event but you don't have a mapReady function in your app.
          dojo.connect(map, "onLoad", mapReady);    

The basemap gallery should be created once the map has loaded so try adding the logic in the mapReady function and it should work.

      function mapReady(){
          createBasemapGallery();
       
      }
0 Kudos
CraigMcDade
Occasional Contributor III
I have tried your suggestion and it didn't do it.

Alternatively I just deleted the mapReady reference from the listener. That made the basemaps gallery load and switch correctly.

However, doing that now causes my initial basemap to not load and the map to not resize.
0 Kudos
CraigMcDade
Occasional Contributor III
still scratching my head on this. I now have a live link to my app so maybe that'll help demonstrate my issue better.

The basemap gallery is not working properly and I get the error:

TypeError: Unable to get value of the property '_basemapGalleryLayerType': object is null or undefined

when trying to switch basemaps.

Thanks.

*Right now its only been tested in IE.*
0 Kudos
CraigMcDade
Occasional Contributor III
In your app it looks like you setup the listener for the maps onLoad event but you don't have a mapReady function in your app.
          dojo.connect(map, "onLoad", mapReady);    

The basemap gallery should be created once the map has loaded so try adding the logic in the mapReady function and it should work.

      function mapReady(){
          createBasemapGallery();
       
      }


Just realized I have a mapReady function in my external identify.js file.
0 Kudos
derekswingley1
Frequent Contributor
I see multiple "dojo is not defined" errors when trying to load your app in Chrome:

Uncaught ReferenceError: dojo is not defined findGrid.js:1
Uncaught ReferenceError: dojo is not defined identify.js:1
Uncaught ReferenceError: dojo is not defined index.html:27


The page also fails in IE. Can you re-visit your live link and make sure we can repro the error there?
0 Kudos