Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions lib/map.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require 'mapbox.js'

module.exports = class Map
domId: 'geosockets'
tileSet: 'examples.map-20v6611k' # 'financialtimes.map-w7l4lfi8'
styleLayer: 'mapbox://styles/mapbox/satellite-streets-v10'
lastRenderedAt: 0
maxRenderInterval: 5*1000 # Don't render more than once every five seconds
users: [] # Container array for geodata between renders
Expand Down Expand Up @@ -39,17 +39,23 @@ module.exports = class Map
link = document.createElement("link")
link.rel = "stylesheet"
link.type = "text/css"
link.href = "https://api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.css"
link.href = "https://api.tiles.mapbox.com/mapbox.js/v3.1.0/mapbox.css"
document.body.appendChild link

# Set required public access token
L.mapbox.accessToken = 'pk.eyJ1IjoiY3JjYXN0bGUiLCJhIjoiY2oxc2F4ejI4MDBkNjMybzZ0aTNjcXY2MiJ9.IF5z_CXdbmbF66ildjTM0A'

# Create the Mapbox map
@map = L.mapbox
.map(@domId, @tileSet)
.map(@domId)
.setView(@defaultLatLng, @defaultZoom)
.locate
setView: true
maxZoom: 11

# Use styleLayer to add a Mapbox style created in Mapbox Studio
L.mapbox.styleLayer(@styleLayer).addTo(@map);

# Enable fullscreen option
@map.addControl(new L.Control.Fullscreen());

Expand Down
2 changes: 1 addition & 1 deletion lib/user-store.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = class UserStore

constructor: (cb) ->
@ttl = 60*15
@url = require("url").parse(process.env.OPENREDIS_URL or 'redis://localhost:6379')
@url = require("url").parse(process.env.REDIS_URL or 'redis://localhost:6379')
@redis = redis.createClient(@url.port, @url.hostname)
@redis.auth(@url.auth.split(":")[1]) if @url.auth

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
"coffee-script": "~1.6.3",
"ws": "~0.4.31",
"express": "~3.4.0",
"redis": "~0.8.4",
"hiredis": "~0.1.15",
"redis": "~2.7.1",
"hiredis": "~0.5.0",
"cookie-cutter": "~0.1.0",
"domready": "~0.2.12",
"node-uuid": "~1.4.1",
"geolocation-stream": "0.0.1",
"mapbox.js": "~1.3.1",
"mapbox.js": "~3.1.0",
"is-mobile": "~0.2.2",
"merge": "~1.1.2"
},
Expand All @@ -44,6 +44,6 @@
"grunt-coffeeify": "~0.1.3"
},
"engines": {
"node": "0.10.x"
"node": "7.9.0"
}
}
Loading