koopjs / koop

Transform, query, and download geospatial data on the web.
http://koopjs.github.io
Other
659 stars 127 forks source link

Koop URL form not supported in ArcGIS Online Scene Viewer #318

Closed rgwozdz closed 6 years ago

rgwozdz commented 6 years ago

TL;DR

Scene Viewer rejects the Koop layer URL because it doesn't contain an expected rest/services fragment normally found in ArcServer URLs.
Details Koop services are rejected in ArcGIS Online 3D Scene Viewer. The UI reports the follow error: Layer cannot be added Service url is not a valid ArcGIS resource url

After stepping through the ArcGIS Online 3D Scene Viewer client code, I found the blocking issue. When a Layer URL is submitted, that URL is expected to fit the ArcGIS server route pattern; specifically, it must contain rest/services otherwise it is rejected. Here is the line in the Scene Viewer client code:

l.match = new RegExp("^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(" + l.serverTypes.join("|") + "))(?:\\/(?:layers\\/)?(\\d+))?","i");

Essentially, the layer URL is rejected because it doesn't contain an expected rest/services fragment. It's possible that this is also the case for ArcGIS Earth - a similar UI error is reported, but I currently have no access to internals for inspection.

Koop provides flexibility in its URLs, but currently omits the rest/services. It may be possible to add this fragment prior to the Koop provider namespace, but consequences to downstream consumers is so far unknown.

jptheripper commented 6 years ago

in the provider you could always call it

module.exports = { name: 'giskoop/rest/services/servicename',

i do this to make firewall rules easier (put rules up at the giskoop level) and it works great

rgwozdz commented 6 years ago

@jptheripper - thanks, that gets me further with Scene Viewer, but then the app attempts a call to /rest/info?f=json and I not surprisingly get 404 (Not Found) as FeatureServer doesn't include that route.

rgwozdz commented 6 years ago

Getting a second error from Scene Viewer (when viewing local scene) which may be a greater issue than the 404 mentioned above:

[esri.core.Accessor] Accessor#set Assigning an instance of 'esri.core.Collection' which is not a subclass of 'esri.core.Collection<esri.symbols.IconSymbol3DLayer | esri.symbols.ObjectSymbol3DLayer | esri.symbols.TextSymbol3DLayer>'
rgwozdz commented 6 years ago

rest/services/ and rest/info routes are now supported with koop-output-geoservices v 1.2.0 and FeatureServer 2.12.0. Using these versions, providers will have routes noted here. Scene viewer can then leverage the layer routes to load Koop data , e.g., http://127.0.0.1:8080/craigslist/rest/services/sarasota/apartments/FeatureServer/0