Custom WebSocket Server + StreamLayer + JS API >= 4.9

4813
13
Jump to solution
03-05-2019 05:03 AM
Raul_Jimenez
Esri Contributor

From this question we realized that the StreamLayer documentation explained that the following could be done:

You may also use your own web socket server, as long as it emits geographic features in the Esri JSON format.

So Jorge Barrachina Gutiérrez and I are just doing an experiment to connect a StreamLayer with a custom websocket server (built with NodeJS) and it's working in JS API 3.x & 4.x except in versions >= 4.9. We noticed in this version (4.9) the StreamLayer was updated, so we guess something might be broken because to our understanding the changes shouldn't affect to the behaviour of this example.

I have recorded a video to show you the issue:

Does anyone have any idea what might be going on? In case you look the source code you can find it on this repo on Github. // cc: John Grayson John Gravois Gavin Rehkemper Sean McGeeMax PaysonRene Rubalcava ‌

---

By the way..., sorry for not been at the DevSummit in Palm Springs! :___(, hopefully we'll see some of you at the DevSummit Europe this year!

0 Kudos
13 Replies
mgeorge
Esri Contributor

Hi Axelle Ribault‌,

In 4.11 we don't yet have support for passing in user-specified WebSocket connections, but you can use GeoEvent server to create a Stream Service.

0 Kudos
Raul_Jimenez
Esri Contributor

Hi Axelle Ribault‌ it is possible to create a custom Stream Service, you can download the one we mentioned before.

Cheers

AxelleRibault
New Contributor II

Impressive, thank you for your work.

Raul_Jimenez
Esri Contributor

Finally Jorge Barrachina Gutiérrez fixed the issue we had, you can see how on this commit.

So feel free to download the code: https://github.com/esri-es/arcgis_websocket_server

FYI: We are still working on the "develop" branch.

Thanks Jorge, you rules!