Select to view content in your preferred language

request for more details in examples

694
2
05-27-2014 12:03 PM
KenDeeds
Regular Contributor
I've noticed throughout the API there are areas like the one I'll highlight on this page: 
https://developers.arcgis.com/javascript/jsapi/graphic-amd.html

This is example of how to do something in your API:

require([
  "esri/graphic", ...
], function(Graphic, ... ) {
  var myLine ={geometry:{"paths":[[[-91.40625,6.328125],[6.328125,19.3359375]]],
    "spatialReference":{"wkid":4326}},
    "symbol":{"color":[0,0,0,255],"width":1,"type":"esriSLS","style":"esriSLSSolid"}};
  var gra= new Graphic(myLine);
  ...
});

The issue is what does "..." equal?  Like is is possible in the future to have a solid example for each function?  For example, if you are showing how to add a line to a map have the full HTML that just makes a map on a blank page and adds one line, something a coder could copy and paste and play with.   In the samples section I can't find an example that adds one line to a map, but tons thatdo all sorts of things on top of adding a line, and it becomes pretty hard just to add a line to map.  Maybe that is the goal, keep it hard and keep simple map programmers at google and bing.  I guess I recently hosted a developers meeting where we discussed using your code.  Since then all that attended have been frustrated away from ever using this code.  The issue with everyone is samples where things like  "..." exist making it impossible to just copy and paste an example into one's one code.  If I was to just make a blank map page with a line what would "..." be equal to, where do I find that.  It's the time people spend figuring this out that really pushes them away from ever using this system.
0 Kudos
2 Replies
MarlaKostuk
Deactivated User
Hi Ken,

I am sorry to hear that you are having issues with the API, maybe this will help clear some things up. This particular example uses the �??�?��?� because if other modules are added in the application then other classes would be placed here. Sometimes it can be more difficult to break down an example. Is there a particular sample that you are working with that I can help you with?

For example:
require([
   "esri/graphic",
          "esri/map",
          �??esri/dijit/Measurement",
          "esri/layers/FeatureLayer",
          "esri/renderers/SimpleRenderer",
          "esri/symbols/SimpleLineSymbol",
          "esri/symbols/SimpleFillSymbol",
         ],
function(Graphic, Map, Measurement, FeatureLayer, SimpleRenderer, SimpleLineSymbol, SimpleFillSymbol){

This stuff is tough to learn at first but there are multiple places that you can turn to. I have attached a couple of resources to get you started. Don't get discouraged, we are always here for you. I always found that adding new things to the samples, breaking it, and fixing helped me get to familiar with the API.


Check out this tutorial

This sample has comments to show where the line is being added

If your application is not working the web debugging tools can help you troubleshoot the issue.

The ArcGIS JavaScript community has a lot of resources to get answer to your questions.

This example explains layouts of applications.

I hope this helps and please let us know if you have other questions! 

-Marla K.
0 Kudos
JohnGravois
Deactivated User
hi ken,

marla is right.  the ellipses are intended to indicate that it is possible (but not required by the snippet itself) to load additional AMD modules.

when you load another unrelated module, you would also refer to that module with a corresponding argument alias.
require([
  "esri/graphic", "esri/secondModule" 
], function(Graphic, secondModule ) {
  var myLine = {geometry:{"paths":[[[-91.40625,6.328125],[6.328125,19.3359375]]],
    "spatialReference":{"wkid":4326}},
    "symbol":{"color":[0,0,0,255],"width":1,"type":"esriSLS","style":"esriSLSSolid"}};
  var gra = new Graphic(myLine);
  ...
});


see this blog for more info
0 Kudos