Select to view content in your preferred language

Different results from different servers using the same JavaScript code?

4501
13
Jump to solution
01-09-2016 04:31 PM
DotMatrix
Deactivated User

I've ran into an issue while making a web app that I cannot figure out. The app allows a user to click on a feature, and edit its attributes using the AttributeInspector. Simple as that. I have a side panel with a div inside <div id="attributes"></div> where the AttributeInspector is created when a feature is selected.

The problem is that the code works fine on my development server, but not on our production server. And I have no idea why. It's the exact same code.

On the production server, when I click on a feature in the map, the AttributeInspector message says "No features selected" in the side panel. But on my development server it actually creates the AttributeInspector and shows the attributes and allows for editing.

When I look at the Network tab on the Chrome developer tools, I can see a successful query and it returns the feature I click on, but for whatever reason it doesn't show the attributes. However, on my development machine it works just fine.

The only difference is that the development machine is running ArcGIS Server 10.31, and our production server is running 10.3.

Any idea what could be wrong? I'm absolutely stumped. I don't know what could be causing the production server to not show the selected features.

0 Kudos
13 Replies
RobertScheitlin__GISP
MVP Emeritus

Dot Matrix,

But are they using data that is hosted from ArcGIS Online?

any time you see services.arcgis.com/xxxxxxxxxxx/arcgis/rest/services you can know that it is a service host on AGOL.

When they talk hosted they are talking about AGOL. Can you chaeck if your development server has the distance property on the rest endpoint page. I am thinking that distance was not added until ArcGIS Server 10.3.1

If you believe that the query is returning then you should inspect the web response in the network tab of your browsers development tools and see if you have actual features returned with attributes and geometry.

0 Kudos
DotMatrix
Deactivated User

Features with attributes and geometry are definitely being returned in the response.

But, I decided to just bite the bullet and upgrade our production server, and it does works now. The features being returned with 10.3 is what was confusing me, and I still don't really understand.

So, this does work with ArcGIS Online and ArcGIS Server 10.3.1 hosted feature services, but NOT 10.3.

Thanks for the assistance!

0 Kudos
JordanBaumgardner
Frequent Contributor

Given that its the same code but different services - Seems like your issue is with the some difference in the services.

Also, I thought that number was in pixels not feet.   The number of px from your click to search so as to not be scale dependent. ( I didn't look it up so don't quote me )

DotMatrix
Deactivated User

Services were created the exact same, just on different servers.

The distance is right in the select query:

selectQuery.geometry = evt.mapPoint;  
selectQuery.distance = 75
selectQuery.units = "feet" 

0 Kudos