featureservice icon indicating copy to clipboard operation
featureservice copied to clipboard

Problems using featureservice in browser

Open mjuniper opened this issue 10 years ago • 2 comments

I am trying to use this in an ember-cli app.

First I tried loading it using ember-browserify because, it seems to me, that's the best way to load an npm module into an ember-cli app. When I called pages, I got "req.setTimeout is not a function". I wonder if I would need to provide browserify options to ember-browserify to make this work? You can see this in this branch: https://github.com/mjuniper/opendata-ember/tree/featureservice-ember-browserify by going to http://localhost:4200/datasets?q= and clicking on a dataset in the table.

Then, I tried loading the browser distribution from /dist. The only way I could figure out how to do that in the context of ember-cli was to copy the file to the vendor directory and then call app.import('vendor/featureservice.min.js'); in ember-cli-build.js which is horrible. In this case, when I call pages, it makes a request to port 443 even though it is an http url. This request eventually times out. You can see this in this branch: https://github.com/mjuniper/opendata-ember/tree/featureservice-vendor by going to http://localhost:4200/datasets?q= and clicking on a dataset in the table.

I'm willing to help fix it but I'd first like to hear people's thoughts. @chelm, @ngoldman, @dmfenton

mjuniper avatar Aug 27 '15 17:08 mjuniper

@mjuniper I'm happy to (have you) modify the code to make it work better in browsers.

  • The HTTPS issue sounds like a bug
  • How can we force timeouts on long running requests in browser compatible js?

I'm interested to hear more about your use case for pulling this into a browser. Bigger picture, what do we need to add or change?

dmfenton avatar Aug 31 '15 19:08 dmfenton

the code forces https requests to all hosted services (at least it should) where https should always be enabled. If its not then its a bug.

chelm avatar Sep 01 '15 01:09 chelm