[英]Dojo Issue: FilteringSelect , required: “false” , not working
[英]Issue on Loading Required Library With dojo
我有dojo js文件,并且已经将ClusterLayer.js
保存在所有目录中,例如
root --> ClusterLayer.js
root --> extras/ClusterLayer.js
root -->js/extras/ClusterLayer.js
root -->js/ClusterLayer.js
和文件就像
require([
"esri/map",
"dojo/_base/array",
"esri/layers/ArcGISDynamicMapServiceLayer",
"esri/geometry/Geometry",
"esri/geometry/Point",
"esri/geometry/webMercatorUtils",
"extras/ClusterLayer",
"esri/graphic",
"esri/symbols/SimpleMarkerSymbol",
"esri/symbols/SimpleLineSymbol",
"esri/symbols/SimpleFillSymbol",
"esri/Color",
"esri/InfoTemplate",
"esri/dijit/HomeButton",
"esri/dijit/OverviewMap",
"dojo/parser",
"esri/layers/GraphicsLayer",
"esri/SpatialReference",
"esri/dijit/PopupTemplate",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dojo/domReady!"
], function(Map, arrayUtils, ArcGISDynamicMapServiceLayer, Geometry, Point, webMercatorUtils, ClusterLayer, Graphic, SimpleMarkerSymbol, SimpleLineSymbol, SimpleFillSymbol, Color, InfoTemplate, HomeButton, OverviewMap, parser, GraphicsLayer, SpatialReference, PopupTemplate)
但仍然出现错误
您能告诉我为什么会这样吗?
有一个ArcGIS教程讨论了如何做到这一点 。 (跳至第4步;显然,链接片段未在页面中正确导航。)
不过,我要指出的是,通常设置packages
比paths
更可取,因此与其设置它:
paths: { extras: location.pathname.replace(/\/[^/]+$/, "") + "/extras" }
我将其设置为:
packages: [
{ name: "extras", location: location.pathname.replace(/\/[^/]+$/, "") + "/extras" }
]
(另请参见Dojo的CDN教程 ,该教程说明了基本相同的情况。)
在这种情况下,两者应大致具有相同的效果。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.