Update to ArcGIS JS API 3.3

722
4
03-18-2013 08:23 AM
demdeberanz
New Contributor II
Dear All,
   so far I've been using the arcgis js api version 2.7 within a web mapping application. I updated the JS api to the version 3.3, I don't get any error but the map doesn't show.
Could you please suggest me possible reasons for this issue?

Thank you very much.
0 Kudos
4 Replies
StephenLead
Regular Contributor III
I'd start with the Migrating to 3.x documentation to see some of the major changes.

The main one is that version 3.x requires your application to be served via a web server, rather than being located on disk.

eg, you should be accessing it via http://localhost/xxx rather than file://c:\temp\xxx
0 Kudos
demdeberanz
New Contributor II
First of all thank you very much for helping me stevel

I'd start with the Migrating to 3.x documentation to see some of the major changes.

Unfortunately I couldn't get any clue to fix my issues.

The main one is that version 3.x requires your application to be served via a web server, rather than being located on disk.
eg, you should be accessing it via http://localhost/xxx rather than file://c:\temp\xxx

I've been already accessing it through a web server (like localhost)

Any other clue?

Thank you very much again.
0 Kudos
MatthewLawton
Occasional Contributor
There are a lot of headaches with this migration. I can sympathize because I have been doing the same migration for over a month now, working out all the kinks.

One of the real pains is that you must absolutely reference this CSS file in 3.x:

<link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/js/esri/css/esri.css">


There are some other things too, like 3.x is very particular about spatial references. Anytime you are setting or changing an extent, you MUST include a spatial reference.

I've just started getting into the migration to AMD references. These aren't critical at this point, but will become so as new versions of Dojo are released. Basically it is just a different way of referencing the ArcGIS modules. Here's an example:

The old way:
dojo.require("esri.map");
dojo.require("esri.tasks.query");
dojo.require("esri.tasks.identify");
dojo.addOnLoad(Init);


The new way:
require(["esri/map", "esri/tasks/query", "esri/tasks/querytask", "esri/tasks/identify"], Init());


I hope this helps.
0 Kudos
StephenLead
Regular Contributor III
Any other clue?


Not without seeing your code, or a link to your site Otherwise it could be.... anything 😉
0 Kudos