Skip to content

Instantly share code, notes, and snippets.

View apollolm's full-sized avatar

Ryan Whitley apollolm

View GitHub Profile
@apollolm
apollolm / gist:b70f1c6cddb631232475
Created November 3, 2014 22:50
SpatialServer Nginx Config
# the IP(s) on which your node server is running. I chose port 3100 - 3103.
# pm2 is also running these 4 instances on these ports.
upstream spatialserver {
server 127.0.0.1:3100;
server 127.0.0.1:3101;
server 127.0.0.1:3102;
server 127.0.0.1:3103;
}
@apollolm
apollolm / site_javascript.html
Last active August 29, 2015 14:08
Same HTML as site.html, but with Javascript to make the page interactive
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>TechDiversified Worshop - The World of JavaScript</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<style>
.section{
@apollolm
apollolm / site.html
Last active August 29, 2015 14:07
Bare bones html file, no javascript. How boring.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>TechDiversified Worshop - The World of JavaScript</title>
<style>
.section{
margin: 20px 0;
@apollolm
apollolm / map.html
Created October 7, 2014 04:32
A map template for the API workshop
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>TechDiversified Worshop - The Power of APIs</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
@apollolm
apollolm / api101.html
Created October 6, 2014 04:35
Tech Diversified - API 101 Starter Page
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>TechDiversified Worshop - The Power of APIs</title>
</head>
<body>
<h1>List of 911 Responses</h1>
L.TileLayer.TileJSON = L.TileLayer.Canvas.extend({
options: {
debug: false
},
tileSize: 256,
initialize: function (options) {
L.Util.setOptions(this, options);
@apollolm
apollolm / gist:8720143
Last active August 29, 2015 13:55 — forked from fnicollet/gist:5764080
DynamicSingleTile is similar to SingleTileWMS overlay for Leaflet map framework, except that it's requesting images from a custom Node.js map server built with mapnik (Chubbs Spatial Server/PGRestAPI)
/*
* from - https://gist.github.com/fnicollet/5764080
* Modified by Ryan Whitley - Jan 30, 2013
* L.DynamicSingleTile uses L.ImageOverlay to display a single-tile layer from node-mapnik.
* url parameter must accept width, height and bbox.
*/
L.DynamicSingleTile = L.ImageOverlay.extend({
initialize: function (url, bounds, options) { // (String, Object)