AnsweredAssumed Answered

Using AGS Map Services and JS Errors

Question asked by johnjmax on Feb 1, 2017
Latest reply on Feb 1, 2017 by rscheitlin

I am new to JavaScript but I managed to modify the sample code from the "Search using suggestion template" to create what I needed.  There are two issues I'm having, though.

 

1. I can only get the layers to display and be searchable if they are uploaded to ArcGIS Online.  When I reference the map services on our AGS in the code it doesn't work.  Is it because we are still using AGS 10.2.2 or will this not work with map services perhaps?

 

2. When our website administrator adds the code to our website, it generates JavaScript errors and the map will only load correctly maybe half the time.  It requires several refreshes to get it to load completely with the labels and search box sometimes.  Here's what he told me if this makes sense to anyone. 

 

It is a conflict between ArcGIS and two JS files from WordPress.

 Standalone, the ArcGIS map code doesn’t generate a JS error.  But mix it in with our WordPress framework and BAM!  JS error.  It is one of these two files:

 /wp-includes/js/imagesloaded.min.js?ver=3.2.0

/wp-includes/js/masonry.min.js?ver=3.3.2

 Error Message: “TypeError: b is undefined (masonry file 11:43)”

 

Thanks,

John

Outcomes