I am starting with the ESRI Popup Sample script straight out of the box. Nothing changed other than all http references are now https..
Here it is running from our web server. https://ecouncil.portenf.sa.gov.au/mapping/InspectorLoc/esri-popup-sample.html
Now I try to alter it to do some extra things like defining my own basemap.
Here is the same code and all I have done is added "esri/basemaps", in the require section. Nothing more.
https://ecouncil.portenf.sa.gov.au/mapping/InspectorLoc/esri-popup-sample_moduleadded.html
It has caused the popup creation command to fail with an error (using IE10) : "SCRIPT438: Object doesn't support property or method 'create' "
This is the command where it breaks
var popup = new Popup({
fillSymbol: fill,
titleInBody: false
}, domConstruct.create("div"));
Why would simply adding a module break another one ? Is there a special order I have to list them ?
This is the order I have done it :
require([
"esri/map",
"esri/basemaps",
"esri/dijit/Popup", "esri/dijit/PopupTemplate",
"esri/layers/FeatureLayer",
"esri/symbols/SimpleFillSymbol", "esri/Color",
"dojo/dom-class", "dojo/dom-construct", "dojo/on",
"dojox/charting/Chart", "dojox/charting/themes/Dollar",
"dojo/domReady!"
], function(........
Solved! Go to Solution.
Georgie,
The most common mistake for JS API beginners is that they add a require and there vars do not match. You have to have your requires aligned with the vars in order. See line 12. You added the require but you never added the corresponding var
require([ "esri/map", "esri/basemaps", "esri/dijit/Popup", "esri/dijit/PopupTemplate", "esri/layers/FeatureLayer", "esri/symbols/SimpleFillSymbol", "esri/Color", "dojo/dom-class", "dojo/dom-construct", "dojo/on", "dojox/charting/Chart", "dojox/charting/themes/Dollar", "dojo/domReady!" ], function( Map, esriBasemaps, Popup, PopupTemplate, FeatureLayer, SimpleFillSymbol, Color, domClass, domConstruct, on, Chart, theme )
I did not continue to check your code for other errors.
Georgie,
The most common mistake for JS API beginners is that they add a require and there vars do not match. You have to have your requires aligned with the vars in order. See line 12. You added the require but you never added the corresponding var
require([ "esri/map", "esri/basemaps", "esri/dijit/Popup", "esri/dijit/PopupTemplate", "esri/layers/FeatureLayer", "esri/symbols/SimpleFillSymbol", "esri/Color", "dojo/dom-class", "dojo/dom-construct", "dojo/on", "dojox/charting/Chart", "dojox/charting/themes/Dollar", "dojo/domReady!" ], function( Map, esriBasemaps, Popup, PopupTemplate, FeatureLayer, SimpleFillSymbol, Color, domClass, domConstruct, on, Chart, theme )
I did not continue to check your code for other errors.
Thanks Robert, Haven't used the Javascript API since it changed to AMD style. I've learn't something today !