Anders Brownworth

Technology and Disruption

Just Released: pub-sub-map, Publish and Subscribe to Real-time Locations on a Map

I have open-sourced pub-sub-map, a node.js driven web application that presents a map and lets you subscribe to real-time location markers. As marker positions get updated, the new location is pushed to all web browsers subscribed to them in real-time.

How could this be useful? Coupled with an iOS application I'm writing, you could follow a number of runners in a marathon, or see where all the taco trucks or taxis are. Scraping data from various mass transit systems, you could have a realtime display of where all the trains and busses are. Or you could track a model rocket or stratospheric balloon project to see where it lands. Basically, pub-sub-map can be useful for anything that moves where any number of people want to follow in realtime. It is an expansion of what you can already do right now with http://EyeZo.com.

I use express as a web framework running in node.js with jade templates to render the web frontend. I don't use polling to push location information. Instead, all location updates are pushed to subscribed browsers via socket.io also running in the same node.js application.

Here's a video of pub-sub-map in action.



pub-sub-map is the next-generation engine I am developing for http://eyezo.com. Give it a try and let me know what you think.

Comments (4)

Chris from Denver, CO

I recently started a project where I need to send sort of pub/sub messaging from a native iOS app to basically a web app. We previously used Cometd to supply this functionality between two web apps. However, we really want the iOS app to be native Objective-C, but there doesn't appear to be a current Objective-C library for Cometd. I was wondering how you were accomplishing the pub/sub with your iOS app, and if you have any suggestions??
Thanks!!

Anders from Cambridge, MA

Chris: We're doing pub-sub on iOS in two ways which I'll term "old busted" and "new hotness". The "old busted" way was simply JSON HTTP posts to a rails server. Obviously you have to poll, so not very interesting. The "new hotness" is MQTT, which gives you both a lightweight TCP channel and a pub-sub capability. Your two options are libmosquitto and mqttIO-iOS-SDK. We're on libmosquitto (so is the Facebook iOS app I hear) but only because it was the only option "back in the day(tm)". I need to try mqttIO-iOS-SDK as it is "more native". (Objective-C) On the server side we are using node.js with MQTT.js - works (and scales) like a champ.

Best of luck!

Mahesh from Bangalore,India

I am trying to run the project u have shared on github, its says server started and listening on port 8070 , but web page is blank , please help.

Anders from Cambridge, MA

The code needs to be updated to Express 4. I just checked in a fix that will pick the proper version of jade making this work. Do a pull, remove your node_modules/ directory and nom install.

Leave a Comment

Name:
Location: (city / state / country)
Email: (not published / no spam)
Comment:

No HTML is allowed. Cookies must be enabled to post. Your comment will appear on this page after a moderator OKs it. Offensive content will not be published.

Click the firetruck to submit your comment.

To create links in comments:
[link:http://anders.com/] becomes http://anders.com/
[link:http://anders.com/|Anders.com] becomes Anders.com
Notice there is no rel="nofollow" in these hrefs. Links in comments will carry page rank from this site so only link to things worthy of people's attention.