Skip to content

Instantly share code, notes, and snippets.

View zross's full-sized avatar

Zev Ross zross

View GitHub Profile
@zross
zross / index.html
Last active April 11, 2024 08:33
Animate path on Leaflet map using D3 (Gimme!, Proletariat)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" />
<script src="http://d3js.org/d3.v3.min.js" type="text/javascript"></script>
<script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script>
<script src='https://api.tiles.mapbox.com/mapbox.js/v1.6.4/mapbox.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/v1.6.4/mapbox.css' rel='stylesheet' />
@zross
zross / businesses.json
Last active April 4, 2024 23:29
Leaflet.js Tips, Step 6 (add hovers)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zross
zross / businesses.json
Last active March 25, 2024 14:08
Leaflet.js Tips, Step 3 (markers and fitBounds)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zross
zross / esri-leaflet.js
Last active February 22, 2024 17:09
Adding ArcGIS services to LeafletJS
/*! Esri-Leaflet - v0.0.1-beta.4 - 2014-03-09
* Copyright (c) 2014 Environmental Systems Research Institute, Inc.
* Apache License*/
L.esri={_callback:{}},L.esri.Support={CORS:!!(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest)},L.esri.RequestHandlers={CORS:function(a,b,c,d){var e=new XMLHttpRequest;b.f="json",e.onreadystatechange=function(){var a;if(4===e.readyState){try{a=JSON.parse(e.responseText)}catch(b){a={error:"Could not parse response as JSON."}}d?c.call(d,a):c(a)}},e.open("GET",a+"?"+L.esri.Util.serialize(b),!0),e.send(null)},JSONP:function(a,b,c,d){var e="c"+(1e9*Math.random()).toString(36).replace(".","_");b.f="json",b.callback="L.esri._callback."+e;var f=L.DomUtil.create("script",null,document.body);f.type="text/javascript",f.src=a+"?"+L.esri.Util.serialize(b),f.id=e,L.esri._callback[e]=function(a){d?c.call(d,a):c(a),document.body.removeChild(f),delete L.esri._callback[e]}}},L.esri.get=L.esri.Support.CORS?L.esri.RequestHandlers.CORS:L.esri.RequestHandlers.JSONP,L.esri.Mixins={},
@zross
zross / california_nad83_zones_min.geojson
Last active July 27, 2023 22:24
Using geojson with Google Maps API
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zross
zross / businesses.json
Last active June 27, 2023 13:36
Leaflet.js Tips, Step 7 (filter buttons)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zross
zross / index.html
Created October 21, 2014 16:18
Example of Google Places Library (get place details if you have place ID)
<!DOCTYPE html>
<html>
<head>
<title>Place details</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;
@zross
zross / county.json
Last active May 3, 2023 19:23
Putting TopoJSON on a Google Map
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zross
zross / shakespeare.csv
Created January 14, 2015 01:39
Shakespeare word count by work (from Google BigQuery)
We can't make this file beautiful and searchable because it's too large.
"","word","word_count","corpus","corpus_date"
"1","hive",1,"loverscomplaint",1609
"2","plaintful",1,"loverscomplaint",1609
"3","Are",1,"loverscomplaint",1609
"4","Than",1,"loverscomplaint",1609
"5","attended",1,"loverscomplaint",1609
"6","That",7,"loverscomplaint",1609
"7","moisture",1,"loverscomplaint",1609
"8","praised",1,"loverscomplaint",1609
"9","particular",1,"loverscomplaint",1609
@zross
zross / businesses.json
Last active April 29, 2022 02:42
Leaflet.js Tips, Step 2 (getJSON)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.