From 429b7bfc25fd6a71243f18c4bf626a1f8164b3e8 Mon Sep 17 00:00:00 2001 From: Code WvS Date: Sat, 7 Feb 2015 11:44:52 +0100 Subject: set initial zoom to current position --- snap.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/snap.html b/snap.html index 7ae8234..47184f0 100755 --- a/snap.html +++ b/snap.html @@ -43,7 +43,8 @@ window.map = map; window.layer = layer; - map = L.map('map').setView([51.505, -0.09], 13); + map = L.map('map'); + map.locate({setView: true, maxZoom: 16}); layer = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { attribution: '© OpenStreetMap contributors' }).addTo(map); -- cgit v1.3.1