Skip to content

Instantly share code, notes, and snippets.

@MrTiggr
Created August 17, 2014 06:49
Show Gist options
  • Select an option

  • Save MrTiggr/2c57211dabdfb8a6c775 to your computer and use it in GitHub Desktop.

Select an option

Save MrTiggr/2c57211dabdfb8a6c775 to your computer and use it in GitHub Desktop.
designer
<link rel="import" href="../esri-html5/esri-realtime.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
box-sizing: border-box;
}
</style>
<div>{{ $.wsConnection.data.data.attributes.FltId }}</div>
<div>
<span>{{ $.wsConnection.data.data.attributes.deparpt }}</span>
<span>
<strong> TO </strong>
</span>
<span>{{ $.wsConnection.data.data.attributes.arrarpt }}</span>
</div>
<realtime-websocket json jsonreceive url="ws://globe.geo5.org" id="wsConnection" on-wsmessage="{{ on_update }}" on-open="{{ on_open }}" on-error="{{ on_error }}"></realtime-websocket>
</template>
<script>
Polymer('my-element', {
on_update: function (evt,det,snd){
console.log("WS MESSAGE",evt,det,snd);
},
on_open: function (evt,det,snd){
console.log("WS OPEN",evt,det,snd);
},
on_error: function (evt,det,snd){
console.log("WS ERROR",evt,det,snd);
}
});
</script>
</polymer-element>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment