Sure, I actually spoke a hair too soon about the "Type Error: cannot call method 'setRenderer' of null", after I posted my first comment I closed the browser and restarted it and I was no longer receiving that error, so now the map is up and running but I am still getting an error on creating an extent, Uncaught ReferenceError: esri is not defined, it is pointing to this little bit of code :
Robert,Check out the 'Migrating to 3.0' doc for some tips on upgrading your app:http://help.arcgis.com/en/webapi/javascript/arcgis/help/jshelp/migration_30.htmIf that doesn't help can you provide a code snippet that shows the problem?
var initExtent = new esri.geometry.Extent({ "xmin":-15654227.28, "ymin":1644618.94, "xmax":-6848681.62, "ymax":7514982.71, "spatialReference":{ "wkid":102100} });
var sfs = new esri.symbol.SimpleFillSymbol( esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol( esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0, 0, 0]), 0.5 ), null );
Im having a similar issue. I upgraded my map to 3.0 this morning and at first it would not work at all until I moved some variables around. Got it too work temporarily, went to lunch, and when I got back it was no longer working. The error is "Type Error: cannot call method 'setRenderer' of null". It is referring to where I call map.graphics.setRenderer(renderer), I had it working on 2.8 and even on 3.0 for a little but all of sudden the map stopped working. Also getting "Uncaught Error: esri is not defined" when I try to create an extent object to be used as my initial extent.
esri.dijit.BasemapGallery.prototype._markSelected = function (basemap) { if (basemap) { // unselect all basemap gallery items dojo.forEach(dojo.query(".esriBasemapGallerySelectedNode", this.domNode), function (node) { dojo.removeClass(node, "esriBasemapGallerySelectedNode"); }); // select current basemap gallery item var basemapNode = dojo.byId("galleryNode_" + basemap.id); if (basemapNode) { dojo.addClass(basemapNode, "esriBasemapGallerySelectedNode"); } } }
Kelly, the CORS issue I am fine with ignoring, the fact that the sample code for creating a basemap gallery breaks is not related to CORS. The link to the sample is here http://help.arcgis.com/en/webapi/javascript/arcgis/demos/widget/widget_basemapManual.htmlon line 83 var basemapGallery = new esri.dijit.BasemapGallery({ showArcGISBasemaps:false, basemaps:basemaps, map:map },"basemapGallery"); basemapGallery.startup(); that call causes an uncaught error: "Uncaught TypeError: Cannot read property 'className' of null "this is the issue that still exists and cannot be ignored.
var basemapGallery = new esri.dijit.BasemapGallery({ showArcGISBasemaps:false, basemaps:basemaps, map:map },"basemapGallery"); basemapGallery.startup();
This error can be ignored - here's a blurb from the help on this error:Automatic detection of CORS support. This is done by attempting to access the /<instance-name>/rest/info endpoint of any ArcGIS server instance used in an ArcGIS API for JavaScript application. For servers that do not support CORS, this request will fail and an error will be logged to the browser's developer console. This can be observed in most of the API's samples as the majority of the servers used do not support CORS. This error can safely be ignored. There are cases where the API will not send a request to /<instance-name>/rest/info and are as follows:The browser does not support CORSThe Server is already listed in esri.config.defaults.io.corsEnabledServersesri.config.defaults.io.corsDetection is falseJSON is used instead of JSONP in the following cases:The resource being fetched is on the same domain as the applicationThe resource being fetched is on a server that supports CORSTo read the blurb in context see the API reference for esri.requesthttp://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/namespace_esri.htm
I was able to get rid of the cross origin error by adding the allow cross origin header. I used the instructions here: http://enable-cors.org/ I still get the "Uncaught TypeError: Cannot read property 'className' of null " error even after this is fixed, this is the issue I am considering to be a bug until I hear otherwise.
I am attempting to upgrade to version 3.0 of the API, and I have started getting errors. The error I get is seen in the sample http://help.arcgis.com/en/webapi/javascript/arcgis/demos/widget/widget_basemapManual.html I imagine this is a bug since the sample is broken as well. Has anyone else seen or resolved this issue?Thanks,Adam ConnerCity of Philadelphia
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.