Skip to content

Instantly share code, notes, and snippets.

Bill Morris wboykinm

Block or report user

Report or block wboykinm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View demo_geojson.js
var bmore_east = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
@wboykinm
wboykinm / index.html
Last active Aug 29, 2015
Leaflet/Mapbox.js GeoJSON with Google Static Chart API in the popup
View index.html
<!doctype html>
<html>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<link href='https://api.tiles.mapbox.com/mapbox.js/v1.6.1/mapbox.css' rel='stylesheet' />
<link href="http://netdna.bootstrapcdn.com/bootswatch/3.0.2/simplex/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="http://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v0.4.0/MarkerCluster.css" />
<link rel='stylesheet' href='http://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v0.4.0/MarkerCluster.Default.css' />
<style>
@wboykinm
wboykinm / index.html
Last active Aug 29, 2015
Foursquare API call (from @tmcw)
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>#BTV Places from Foursquare</title>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox.js/v1.6.1/mapbox.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/v1.6.1/mapbox.css' rel='stylesheet' />
@wboykinm
wboykinm / index.html
Created Feb 4, 2014
Base Layer switch example
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Layers Control</title>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox.js/v1.6.1/mapbox.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/v1.6.1/mapbox.css' rel='stylesheet' />
@wboykinm
wboykinm / index.html
Created Feb 3, 2014
Bars on Foursquare around Burlington VT
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>#BTV Places from Foursquare</title>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox.js/v1.6.1/mapbox.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/v1.6.1/mapbox.css' rel='stylesheet' />
View geojson-conversion.sh
# Bulk convert shapefiles to geojson using ogr2ogr
# For more information, see http://ben.balter.com/2013/06/26/how-to-convert-shapefiles-to-geojson-for-use-on-github/
# Note: Assumes you're in a folder with one or more zip files containing shape files
# and Outputs as geojson with the crs:84 SRS (for use on GitHub or elsewhere)
#geojson conversion
function shp2geojson() {
ogr2ogr -f GeoJSON -t_srs crs:84 "$1.geojson" "$1.shp"
}
View jsv2 polygons to geojson
// gmaps js api v2 polygon overlays -> geojson
overlayToGeoJSON = function(o){
var feature={type:'Feature', geometry:{ type:'Polygon', coordinates:[]}};
for (var i=0; i < o.latlngs.length; i++){
feature.geometry.coordinates.push([o.latlngs[i].lng, o.latlngs[i].lat])
}
feature.properties = {hint:o.hint, html: o.infohtml}
return feature;
}
var results={type: "FeatureCollection", features: []};
@wboykinm
wboykinm / ecos_concessions.geojson
Last active Aug 29, 2015
Oil Concessions in Sudan, 2007 (pre-independence) source: ECOS http://www.ecosonline.org/oilmap/
View ecos_concessions.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View buildings.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wboykinm
wboykinm / index.html
Last active Aug 29, 2015
Leaflet-omnivore using topojson from CartoDB SQL API
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Leaflet Omnivore with CSV Data</title>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox.js/v1.6.1/mapbox.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/v1.6.1/mapbox.css' rel='stylesheet' />
You can’t perform that action at this time.