Javascript API & Flickr help

3278
2
Jump to solution
06-17-2015 08:38 AM
ToddBlanchette
Occasional Contributor II

Morning all - I'm slowly losing my mind!  I've started a webpage so that I can play around with the Javascript API and Flickr.  I've copied and pasted the ESRI sample for this, found here Feature collection | ArcGIS API for JavaScript , and it runs great if I run it as is, on my own web server.

My issues come when I try to design a new page around it.  I haven't changed any of the code for the feature collection itself, just some of the map constructor, CSS and content, and added a location search widget.  When I try and run my new page (with Chrome debugger) the map loads fine, the search works great, but the Flickr features don't show up.  The debugger spits out an error when it gets to the RequestSucceded() function, telling me that "TypeError: array.forEach is not a function."  From my research, it appears I'm not giving a proper array to the function to play with - I just don't see how I'm passing anything different to the function than what the source code originally passes... anyone have any ideas on this?  Source code for both included (index.html is my page that doesn't work, index3.html is the ESRI sourcecode).

0 Kudos
1 Solution

Accepted Solutions
RickeyFight
MVP Regular Contributor

Todd,

You do not have multiple requires. You can combine everything after the require.

Just make sure that the function() match the same order.

require(["esri/map", 
               "esri/dijit/Geocoder",
               "dojo/ready"],
               function(Map, Geocoder, ready){

View solution in original post

2 Replies
RickeyFight
MVP Regular Contributor

Todd,

You do not have multiple requires. You can combine everything after the require.

Just make sure that the function() match the same order.

require(["esri/map", 
               "esri/dijit/Geocoder",
               "dojo/ready"],
               function(Map, Geocoder, ready){
ToddBlanchette
Occasional Contributor II

Thanks Rickey, I wasn't aware that the order of the function parameters had to match the requires.  I moved it around and they're showing up now.

Thanks!

0 Kudos