koopjs / FeatureServer

An open source Geoservices Implementation (deprecated)
https://geoservices.github.io
Other
101 stars 32 forks source link

Support for esri Mobile devices android/iOS #155

Open keithfraley opened 5 years ago

keithfraley commented 5 years ago

I cant seem to figure this one out, my services work fine in AGOL but will not display on the mobile apps. I notice that the request from the mobile app has an inSR and outSR as 3857 and that the browser is 102100. Above and beyond that there is no geometry.spatialReference set with mobile requests.

The only thing I can think is that the mobile devices are looking for something in the returned json that isnt there and thus can't draw.

keithfraley commented 5 years ago

Screenshot 2019-06-20 at 4 52 23 PM

notice the latestWKID field in the esri json

keithfraley commented 5 years ago

Koop JSON Request from browser

{ f: 'json', returnGeometry: 'true', spatialRel: 'esriSpatialRelIntersects', maxAllowableOffset: '39135', geometry: '{"xmin":-0.000004857778549194336,"ymin":-20037508.34277919,"xmax":20037508.34277919,"ymax":0.000004857778549194336,"spatialReference":{"wkid":102100,"latestWkid":3857}}', geometryType: 'esriGeometryEnvelope', inSR: '102100', outFields: '*', outSR: '102100' }

Koop JSON Request from mobile

{ returnZ: 'false', returnM: 'false', inSR: '3857', outFields: '*', f: 'json', maxAllowableOffset: '0', geometry: '{"xmin":-10704875.262819186,"ymin":3090630.0604087398,"xmax":-10410893.716729376,"ymax":3639429.6162773357}', returnGeometry: 'true', spatialRel: 'esriSpatialRelEnvelopeIntersects', geometryType: 'esriGeometryEnvelope', outSR: '3857', returnDistinctValues: 'false' }

My provider is getting the proper data from the datastore and data is being sent back to the device, it isn't just rendering for some reason, the legend is drawing however...

rgwozdz commented 5 years ago

Hey @keithfraley - 3857 and 102100 are the same spatial reference. See https://community.esri.com/thread/211091-wkid-102100-wkid-3857.

I think you are probably right in that the mobile devices are looking for something in the returned json that isn't there and thus can't draw. In my experience, ArcGIS clients fire off a whole series of requests (e.g., layer info request, feature count request, query, etc). So it could something different in any one of those requests.

Debugging this kind of issue is tricky, because we don't have dev tools on the mobile apps. My approach would be to use Fiddler to watch and examine the set of requests targeting the mobile app from (1) AGOL and (2) Koop. There will likely be a difference. See https://www.telerik.com/blogs/how-to-capture-android-traffic-with-fiddler for using Fiddler on mobile.