simplegeo / polymaps

Polymaps is a free JavaScript library for making dynamic, interactive maps in modern web browsers.
http://polymaps.org/
Other
1.6k stars 213 forks source link

Reset Button #113

Closed ghost closed 12 years ago

ghost commented 12 years ago

Has anyone added a reset button to reset the view of the zoom layer of the original page load?

shawnbot commented 12 years ago

Sorry, but this doesn't belong in the library. You can accomplish it with an HTML button and a click handler:

<button id="reset">reset</button>
// var map = ...
var initialZoom = 10;
document.getElementById("reset").addEventListener("click", function() {
  map.zoom(initialZoom);
});