I'm working on creating a custom widget and getting 404 errors when loading some of the modules. It's getting kind of frustrating. Here's my code:
define(['dojo/_base/declare',
'jimu/BaseWidget',
'esri/config',
'esri/Map',
'esri/views/MapView',
'esri/Graphic',
'esri/layer/GraphicsLayer',
'esri/widgets/BasemapToggle',
'esri/layers/FeatueLayer',
'esri/widgets/Search',
'esri/geometry/support/webMecatorUtils'],
function(declare,
BaseWidget,
esriConfig,
Map,
MapView,
Graphic,
GraphicsLayer,
BasemapToggle,
FeatueLayer,
Search,
webMecatorUtils) {
//To create a widget, you need to derive from BaseWidget.
return declare([BaseWidget], {
// Custom widget code goes here
baseClass: 'jimu-widget-customwidget',
//this property is set by the framework when widget is loaded.
//name: 'CustomWidget',
//methods to communication with app container:
postCreate: function() {
this.inherited(arguments);
esriConfig.apiKey = "AAPKfea68ae1a29b4910a49caaf684e7cb88U00vbv7ih-yUUj82Xc0P8WvhiF8sgxbqj657tqBEtZhtshNFR_a_FRxY216ANsw";
const map = new Map({ basemap: "arcgis-navigation"});
var graphicslayer = new GraphicsLayer();
map.add(graphicslayer);
var zLatitude = [22.560760, 38.630280, 30.695030];
var zLongitude = [88.295242, -90.200310, -88.041000];
var simpleMarkerSymbol = {
type: "simple-marker",
color: [226, 119, 40],
size: 14,
style: "circle"
};
for(i = 0; i < zLatitude.length; i++)
{
var point = {
type: "point",
longitude: zLongitude[i],
latitude: zLatitude[i],
}
}
var pointGraphic = new Graphic({
geometry: webMecatorUtils.geographicToWebMercator(point),
symbol: simpleMarkersymbol
})
graphicslayer.add(pointGraphic);
},
I get: init.js:36 GET https://js.arcgis.com/3.37/esri/layer/GraphicsLayer.js net::ERR_ABORTED 404.
Did you ever find a fix for this?