Skip to content

Instantly share code, notes, and snippets.

View wboykinm's full-sized avatar

Bill Morris wboykinm

View GitHub Profile
@wboykinm
wboykinm / log_061212
Created June 12, 2012 19:51
Tilemill Log 061212
Starting TileMill...
[tilemill] Creating configuration dir C:\Users\William Morris\.tilemill
Starting TileMill...
[tilemill] Plugin [carto] loaded.
Starting TileMill...
[tilemill] Started [Server Tile:20008].
[tilemill] Plugin [carto] loaded.
[tilemill] Plugin [editor] loaded.
[tilemill] Plugin [fonts] loaded.
[tilemill] Plugin [map] loaded.
@wboykinm
wboykinm / switcher.html
Created June 14, 2012 20:52
tornado swicther site
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Tornadoes in the U.S.</title>
<script src='js/jquery-1.7.1.min.js' type='text/javascript'></script>
<script src='wax/ext/modestmaps.min.js' type='text/javascript'></script>
<script src='wax/dist/wax.mm.js' type='text/javascript'></script>
<link href='wax/theme/controls.css' rel='stylesheet' type='text/css' />
@wboykinm
wboykinm / conease.js
Created June 15, 2012 20:42
Conditional Easing
var cz = map.getZoom()
if cz >= 8 {
map.setZoom({ Take No Action });
}
else {
map.setZoom({8});
}
@wboykinm
wboykinm / vtsoilsinter.html
Created June 16, 2012 19:13
interactivity for vtsoils
<!--teaser-->
{{{MUNAME}}}
<!--full-->
{{{MUSYM}}}</strong><br />{{{MUNAME}}}<br />**********<br />Hydric Soil = {{{HYDRIC}}}<br />Prime Agricultural Soil: {{{PRIME}}}<br /><img src="http://chart.apis.google.com/chart?chf=a,s,000000E6|bg,s,676767&chxs=0,FFFFFF,11.5&chxt=x&chs=220x120&cht=p3&chco=F2F2F2|A69E86|734860&chd=t:{{{sand1}}},{{{silt1}}},{{{clay1}}}&chl=Sand|Silt|Clay&chtt=Soil+Texture+Breakdown&chts=FFFFFF,11.5" width="240" height="120" alt="Soil Texture Breakdown" /><br /><img src="http://chart.apis.google.com/chart?chf=a,s,000000E6|bg,s,676767&chxl=0:|0|&chxp=0,0&chxs=0,676767,11.5,0,lt,676767&chxt=y&chs=220x70&cht=ls&chco=FF0000&chd=t:0,{{{SLOPEHIGH}}}&chdlp=b&chg=5,5&chls=1&chm=B,EFEFEF,0,0,0&chtt=Approximate+Slope&chts=FFFFFF,11.5" width="240" height="70" alt="Maximum Slope" />",
Map {
/*background-color: #b8dee6;*/
}
/*#countries {
::outline {
line-color: #85c5d3;
line-width: 2;
line-join: round;
}
@wboykinm
wboykinm / ol_sudan.js
Created June 29, 2012 16:24
ol_sudan_baselayers
//After line ???, add:
var base = new OpenLayers.Layer.XYZ(
"MapBox Streets",
[
"http://a.tiles.mapbox.com/v3/landplanner.sudan1/${z}/${x}/${y}.png",
"http://b.tiles.mapbox.com/v3/landplanner.sudan1/${z}/${x}/${y}.png",
"http://c.tiles.mapbox.com/v3/landplanner.sudan1/${z}/${x}/${y}.png",
"http://d.tiles.mapbox.com/v3/landplanner.sudan1/${z}/${x}/${y}.png"
], {
@wboykinm
wboykinm / polltt.html
Created August 1, 2012 14:17
poll chart tooltip
<strong>{{{Country}}}</strong><br/>
Total # of Respondents: <b>{{{total}}}</b><img src="http://chart.apis.google.com/chart?chf=bg,s,67676700&chs=60x40&cht=gm&chd=t:{{{total}}}" width="60" height="40" alt="" /><br/>
******************************<br/>
<img src="http://chart.apis.google.com/chart?chf=bg,s,67676700&chs=230x220&cht=p&chco=A6CEE3|1F78B4|B2DF8A|33A02C&chd=t:{{{esriprime}}},{{{fossprime}}},{{{googleprime}}},{{{otherprime}}}&chdl=ESRI|FOSS4G|Google|Other&chdlp=b&chtt=Most-Used+Geo+Platform" width="230" height="220" alt="Most-Used Geo Platform" /><br/>
<br/>
<img src="http://chart.apis.google.com/chart?chf=bg,s,67676700&chs=230x220&cht=p&chco=8DD3C7|FFFFB3|BEBADA|FB8072|80B1D3&chd=t:{{{private}}},{{{gov}}},{{{academic}}},{{{nonprofit}}},{{{other}}}&chdl=Private|Government|Academic|Nonprofit|Other&chdlp=b&chtt=Respondents+by+Sector" width="230" height="220" alt="Respondents by Sector" />
@wboykinm
wboykinm / dds_params.md
Created August 1, 2012 19:35
Data-Driven Symbology Parameters in Mapnik

List of Parameters in Carto that can accept a data field instead of an absolute value, as of Tilemill 0.10.0:

  • marker-width
  • marker-height
  • shield-name
  • text-name
  • text-orientation
  • building-height
  • marker-transform
@wboykinm
wboykinm / hood2json.js
Created August 14, 2012 18:34
hood2json
function hoodToJson( hood ) {
var polygon = polygons[hood];
var array = polygon.getPath().getArray();
var coords = [];
for ( var i=0; i<array.length; i++ ){
coords.push( [ array[i].lng(), array[i].lat() ] );
}
return JSON2.stringify( { type: "Feature", geometry: { type: "Polygon", coordinates: [ coords ] }, properties: { name: hoods[hood].name } } );
}
@wboykinm
wboykinm / hoods9.php
Created August 20, 2012 15:14
Passing geometry from client to DB
<?php
$username = //[user];
$password = //[wouldntyouliketoknow];
$hostname = "localhost";
$database = "geosproc_btvwards";
$dbh=mysql_connect($hostname, $username, $password) or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ($database);
// OBQtypeQ:QFeatureQCOQgeometryQ:OBQtypeQ is my dumb version of {"type":"Feature","geometry":{"type"