Skip to content

Instantly share code, notes, and snippets.

@furilo
Created April 15, 2014 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save furilo/10739694 to your computer and use it in GitHub Desktop.
Save furilo/10739694 to your computer and use it in GitHub Desktop.
$(".donutholes").click(function(e) {
// Get the name of the clicked hole
var donuthole = event.target.text;
sql.getBounds("select * From donutholes where name Like '" + donuthole + "'").done(function(bounds) {
// Extend the pointwise bounds by 10 degrees to enjoy higher zoom level when zooming to feature
var p1 = bounds[0][0] - 10;
var p2 = bounds[0][1] - 10;
var p3 = bounds[1][0] + 10;
var p4 = bounds[1][1] + 10;
map.fitBounds([[p1,p2],[p3,p4]]);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment