Skip to content

Commit

Permalink
maxBounds on map keeps things from getting lost
Browse files Browse the repository at this point in the history
fixes #17
  • Loading branch information
kingfisher13 committed Apr 11, 2016
1 parent 4f80eaf commit 3ff086b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ var map,
lines;

function setupMap(){
map = L.map('map').fitBounds( L.latLngBounds( L.latLng(17.644, -78.409), L.latLng(18.589, -76.190) ) );
map = L.map('map', {
maxBounds: L.latLngBounds( L.latLng(17, -79), L.latLng(19, -76) )
}).fitBounds( L.latLngBounds( L.latLng(17.644, -78.409), L.latLng(18.589, -76.190) ) );
//.setView([18.188, -77.363], 10);
map.setZoom( Math.max( map.getZoom(), 9 ) );
placesMap = L.tileLayer('tiles/placenames/{z}/{x}/{y}.png', {maxZoom: 13, minZoom: 7, tms: true} ).addTo(map);
Expand Down

0 comments on commit 3ff086b

Please sign in to comment.