我正在使用 ArcGIS 3.5 Javascript API 和 RequireJS
我使用以下代码实现了它:
<script>
var map;
require(["esri/map", "dojo/domReady!"], function(Map) {
map = new Map("mapDiv", {
center: [-96.571541, 39.155622],
zoom: 3,
basemap: "streets"
});
});
});
</script>
使用此 RequireJS 配置:
requirejs.config({
baseUrl: "js/",
paths: {
underscore: 'libs/underscore',
tpl: 'tpl',
backbone: 'libs/backbone',
text: 'libs/text',
domReady: 'libs/domReady'
},
packages: [
{
name: 'dojo',
location: "http://serverapi.arcgisonline.com/jsapi/arcgis/3.5compact/js/dojo/dojo/"
},
{
name: 'dojox',
location: "http://serverapi.arcgisonline.com/jsapi/arcgis/3.5compact/js/dojo/dojox"
},
{
name: 'dijit',
location: "http://serverapi.arcgisonline.com/jsapi/arcgis/3.5compact/js/dojo/dijit"
},
{
name: 'esri',
location: "http://serverapi.arcgisonline.com/jsapi/arcgis/3.5compact/js/esri"
}
],
shim: {
'backbone': {
//These script dependencies should be loaded before loading backbone.js
deps: ['underscore'],
//Once loaded, use the global 'Backbone' as the module value.
exports: 'Backbone'
},
'underscore': {
exports: '_'
}
}
});
它显示以下错误:
我有这个错误
**Uncaught TypeError: Object function (){} has no method 'add' has.js:8
Uncaught Error: Load timeout for modules: dojo/domReady!_unnormalized2,dojo/has!dom-addeventlistener?:./aspect_unnormalized3,dojo/i18n!dojo/cldr/nls/number_unnormalized4,dojo/i18n!dojo/cldr/nls/gregorian_unnormalized5,dojo/i18n!esri/nls/jsapi_unnormalized6,dojox/gfx/renderer!_unnormalized7,dojo/selector/_loader!default_unnormalized8,dojo/has!host-browser?dom-addeventlistener?:../on:_unnormalized9**
有没有人有解释,或者关于如何解决它的想法?