位置情報の取得とWebSocketによる送信 [Geolocation APIとwebsocket-railsによる位置情報通知アプリ #1] はじめに ブラウザにて位置情報を取得し、その情報を別のクライアントへPush通知する処理の サンプルをRuby on Railsで作成してみました。 なんらかの業務で、ある社員が持つ端末より位置情報を取得し、本社側でリアルタイムで その情報を把握する、というような用途を想定しています。 アプリの機能としては JavaScriptにて、Geolocation APIを使用して位置情報を取得する websocket-railsを使い、WebSocketでサーバ側へ送信する サーバ側は、受け取った位置情報をwebsocket-railsを使い、別画面へPush通知する の3つに分けることができます。 これらの機能を実装するポイントについて書いていきたいと