From 881165be429151d8f2593c6893dd23da90a5288b Mon Sep 17 00:00:00 2001 From: Code WvS Date: Sat, 28 Feb 2015 16:03:45 +0100 Subject: add map coordinate control --- .gitmodules | 3 +++ Leaflet.Coordinates | 1 + snap.html | 10 +++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) create mode 160000 Leaflet.Coordinates diff --git a/.gitmodules b/.gitmodules index f5b8c36..bb03b17 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "osmbuildings"] path = osmbuildings url = https://github.com/kekscom/osmbuildings +[submodule "Leaflet.Coordinates"] + path = Leaflet.Coordinates + url = https://github.com/MrMufflon/Leaflet.Coordinates diff --git a/Leaflet.Coordinates b/Leaflet.Coordinates new file mode 160000 index 0000000..ff1abfd --- /dev/null +++ b/Leaflet.Coordinates @@ -0,0 +1 @@ +Subproject commit ff1abfd1832bffc733b06be8216b9992077e63e2 diff --git a/snap.html b/snap.html index 81ec7a9..51c861f 100755 --- a/snap.html +++ b/snap.html @@ -5,8 +5,10 @@ Snap! Build Your Own Blocks. Beta + + @@ -55,7 +57,7 @@ }; // Snap! YOW starts here - var world, map, layer, spriteGroup, defaultCostume; + var world, map, layer, spriteGroup; function loop() { world.doOneCycle(); @@ -81,6 +83,12 @@ layer = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { attribution: '© OpenStreetMap contributors' }).addTo(map); + L.control.coordinates({ + decimals: 7, + enableUserInput: false, + labelTemplateLng: "Lon {x}", + position: "topright" + }).addTo(map); // continuously update the local location variable map.on('locationfound', setGlobalPosition); -- cgit v1.3.1