Skip to content

Instantly share code, notes, and snippets.

@pomahtuk
Created August 15, 2013 06:10
Show Gist options
  • Save pomahtuk/6238636 to your computer and use it in GitHub Desktop.
Save pomahtuk/6238636 to your computer and use it in GitHub Desktop.
"40.71399899774998,-73.96226638749108|40.71444900225002,-73.9606376125089"
coords = [40.714224,-73.961452]
lng_corr = 0.05 / (Math.cos(coords[1] * Math.PI / 180) * 111.11) / 2
lat_corr = 0.05 / 111.11 / 2
bounds = [[coords[0] - lat_corr,coords[1] - lng_corr],[coords[0] + lat_corr, coords[1] + lng_corr]]
bounds_string = bounds[0].join(',') + '|' + bounds[1].join(',');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment