Skip to content

Instantly share code, notes, and snippets.

@surma
Created June 6, 2013 15:22
Show Gist options
  • Save surma/5722367 to your computer and use it in GitHub Desktop.
Save surma/5722367 to your computer and use it in GitHub Desktop.
bla
x.forEach(function(val){
var tmp = val.split(";");
var min = [5000, 5000];
var max = [0, 0];
var idx = 0;
tmp[0].split(",").forEach(function(val) {
val = parseInt(val);
if(val < min[idx]) {
min[idx] = val;
}
if(val > max[idx]) {
max[idx] = val;
}
idx = (idx+1)%2;
});
console.log('#themap .location'+tmp[1]+'{\n'+
'\tdisplay: block;\n'+
'\tleft: '+((max[0] + min[0])/2)+'px;\n'+
'\ttop: '+((max[1] + min[1])/2-45)+'px;\n'+
'}\n');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment