AnsweredAssumed Answered

Unable to load 3.1 version using Require.js

Question asked by yshi on Aug 29, 2012
Latest reply on Sep 4, 2012 by odoe
The following code works fine with the 2.7 version but does not work with 3.1 version. When I ran with the 3.1 version, the javascript API throws an error from dojoLoader and consequently not loading dojo. How should I load the 3.1 version using require.js?


[ATTACH=CONFIG]17332[/ATTACH]

define([
  'jQuery',
  'Underscore',
  'Backbone',
  'http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.1'
], function($, _, Backbone){
dojo.require("esri.map");

  var MapView = Backbone.View.extend({

initialize: function () {

  _.bindAll (this, 'render');
 
  var initExtent = new esri.geometry.Extent({"xmin":320000,"ymin":5000000,"xmax":400000,"ymax":5070000,"spatialReference":{"wkid":32189}});
  window.map = new esri.Map("mapDiv", {extent:initExtent});
  this.serviceCollection = this.collection;
  this.serviceCollection.bind ('reset', this.render);
  window.services.bind ('select', this.toggleLayer);
}
})

Attachments

Outcomes