Skip to content

Instantly share code, notes, and snippets.

@mapsense-examples
mapsense-examples / README.mkd
Last active August 29, 2015 14:15
Make a Map

Add a Mapsense basemap with one line. Be sure to replace the API key with your own, found at https://developer.mapsense.co/account/.

The resulting map shows the default map settings. Style, center, and zoom can all be set with additional calls. See the documentation for more details. Analytics

@mapsense-examples
mapsense-examples / README.mkd
Last active August 29, 2015 14:15
Make it Pretty

##Styling a map ###Default Styles Mapsense.css includes a number of pre-made styles for Mapsense basemaps. By default, .basemap() will apply the "light" style. To use another mapsense.css style, add its name as a parameter eg:

.style("vintage") 

###Custom Styles To use your own styles like in this example, include a link to your stylesheet and append

.style(false)

@mapsense-examples
mapsense-examples / analytics.md
Last active August 29, 2015 14:15
Add a GeoJSON

Analytics

We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 23 columns, instead of 17. in line 2.
locationid,Applicant,FacilityType,cnn,LocationDescription,Address,blocklot,block,lot,permit,Status,FoodItems,X,Y,Latitude,Longitude,Schedule,NOISent,Approved,Received,PriorPermit,ExpirationDate,Location
546631,"Cupkates Bakery, LLC",Truck,101000,01ST ST: STEVENSON ST to JESSIE ST (21 - 56),50 01ST ST,3708055,3708,055,14MFF-0102,APPROVED,Cupcakes,6013063.33,2115738.283,37.7901490737255,-122.398658184604,http://bsm.sfdpw.org/PermitsTracker/reports/report.aspx?title=schedule&report=rptSchedule&params=permit=14MFF-0102&ExportPDF=1&Filename=14MFF-0102_schedule.pdf,,06/02/2014 03:32:00 PM,Jun 2 2014 12:23PM,0,03/15/2015 12:00:00 AM,"(37.7901490874965, -122.398658184594)"
598046,Missing Link SF,,103000,01ST ST: ELIM ALY to MISSION ST (72 - 99),97 01ST ST,3709008,3709,008,14MFF-0133,REQUESTED,smoked sausages: deer: wild boar: pheasant: buffalo: beef: turkey: coleslaw: vegetarian baked beans,6013385.483,2115736.96,37.7901633841957,-122.39754345993,http://bsm.sfdpw.org/PermitsTracker/reports/report.aspx?title=schedule
@mapsense-examples
mapsense-examples / analytics.mkd
Last active August 29, 2015 14:15
Raster if you have to

Analytics

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="http://d3js.org/topojson.v1.min.js" charset="utf-8"></script>
<script src="https://developer.mapsense.co/mapsense.js" charset="utf-8"></script>
<link type="text/css" href="https://developer.mapsense.co/mapsense.css" rel="stylesheet"/>
@mapsense-examples
mapsense-examples / index.html
Last active August 29, 2015 14:15
Make a Choropleth
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="http://d3js.org/topojson.v1.min.js" charset="utf-8"></script>
<script src="https://developer.mapsense.co/mapsense.js" charset="utf-8"></script>
<link type="text/css" href="https://developer.mapsense.co/mapsense.css" rel="stylesheet"/>
@mapsense-examples
mapsense-examples / index.html
Last active August 29, 2015 14:15
Interactive Legend
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="http://d3js.org/topojson.v1.min.js" charset="utf-8"></script>
<script src="https://developer.mapsense.co/mapsense.js" charset="utf-8"></script>
<link type="text/css" href="https://developer.mapsense.co/mapsense.css" rel="stylesheet"/>
@mapsense-examples
mapsense-examples / analytics.mkd
Last active August 29, 2015 14:21
Put a point on it

Analytics

@mapsense-examples
mapsense-examples / index.html
Last active September 18, 2016 20:40
Label Me
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="http://d3js.org/topojson.v1.min.js" charset="utf-8"></script>
<script src="https://developer.mapsense.co/mapsense.js" charset="utf-8"></script>
<link type="text/css" href="https://developer.mapsense.co/mapsense.css" rel="stylesheet"/>