Skip to content

Instantly share code, notes, and snippets.

@jpmarindiaz
Created April 3, 2014 22:52
Show Gist options
  • Save jpmarindiaz/9964467 to your computer and use it in GitHub Desktop.
Save jpmarindiaz/9964467 to your computer and use it in GitHub Desktop.
Tributary inlet
{"description":"Tributary inlet","endpoint":"","display":"svg","public":true,"require":[{"name":"datamaps","url":"http://datamaps.github.io/scripts/datamaps.world.min.js?v=1"}],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"pingpong","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"ajax-caching":true,"thumbnail":"http://i.imgur.com/Fl51pJV.png"}
var map = new Datamap({
scope: 'world',
element: document.getElementById('container'),
projection: 'mercator',
fills: {
defaultFill: '#f0af0a',
lt50: 'rgba(0,244,244,0.9)',
gt50: 'red'
},
data: {
USA: {fillKey: 'lt50' },
RUS: {fillKey: 'lt50' },
CAN: {fillKey: 'lt50' },
BRA: {fillKey: 'gt50' },
ARG: {fillKey: 'gt50'},
COL: {fillKey: 'gt50' },
AUS: {fillKey: 'gt50' },
ZAF: {fillKey: 'gt50' },
MAD: {fillKey: 'gt50' }
}
})
//sample of the arc plugin
map.arc([
{
origin: {
latitude: 40.639722,
longitude: 73.778889
},
destination: {
latitude: 37.618889,
longitude: -122.375
},
options: {
strokeWidth: 2,
strokeColor: '#22a437'
}
},
{
origin: {
latitude: 30.194444,
longitude: -97.67
},
destination: {
latitude: 25.793333,
longitude: -0.290556
}
}
], {strokeWidth: 2, arcSharpness: 0.4, strokeColor:'blue'});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment