JSAPI4x
I keep all my js code in a module (main.js) that loads when the page loads. I want to do some client-side projections - I'll need to include esri/geometry/projection.
Unfortunately including esri/geometry/projection in a defined module thrown a 404 error:
dojo.js:23 GET https://js.arcgis.com/4.6/esri/geometry/projection.js 404 ()
I can successfully load esri/geometry/projection in index.html - however I need to project in main.js.
I'm not sure if I need to include other dojo or esri modules in order to include esri/geometry/projection.
Make sense?
define(
[
"dojo/_base/declare",
"dojo/_base/lang",
"esri/geometry/geometryEngineAsync",
"esri/geometry/projection",
"esri/identity/IdentityManager",
"esri/tasks/QueryTask",
"esri/tasks/support/Query",
"esri/Graphic",
"esri/layers/GraphicsLayer",
"esri/geometry/Polygon",
"esri/geometry/Polyline",
"esri/WebMap",
"esri/views/MapView",
"esri/views/2d/draw/Draw",
"dgrid"
],
function(
declare,
lang,
geometryEngineAsync,
projection,
IdentityManager,
QueryTask,
Query,
Graphic,
GraphicsLayer,
Polygon,
Polyline,
WebMap,
MapView,
Draw,
Grid
) {
return declare(null, {
aGeometry: null,
constructor: function () {
// console.log("constructor");
},
doSomething: function(){}
}
})
...
Solved! Go to Solution.
The projection module was added in 4.7, but you're using 4.6
The projection module was added in 4.7, but you're using 4.6