Created
April 15, 2014 15:02
-
-
Save furilo/10739694 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".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