Add locate widget to map
authorTom MacWright <tom@macwright.org>
Mon, 10 Jun 2013 18:36:45 +0000 (11:36 -0700)
committerJohn Firebaugh <john.firebaugh@gmail.com>
Thu, 18 Jul 2013 17:31:19 +0000 (10:31 -0700)
Vendorfile
app/assets/javascripts/index.js

index c2622b16cfac1803bfad3377092d03b8718a72c5..cc590e8bf8a6406563d5c7e1a538af7e37dd7aea 100644 (file)
@@ -16,6 +16,10 @@ folder 'vendor/assets' do
       folder 'img', 'src/img'
     end
 
+    from 'git://github.com/domoritz/leaflet-locatecontrol.git' do
+      file 'leaflet.locate.js', 'src/L.Control.Locate.js'
+    end
+
     from 'git://github.com/jfirebaugh/leaflet-osm.git' do
       file 'leaflet.osm.js', 'leaflet-osm.js'
     end
index 760c95230caa2803c05ad5e31f30f9b7bfecb9a3..9aed3c3f7ebad396a506c6219e520811159be577 100644 (file)
@@ -21,6 +21,9 @@ $(document).ready(function () {
 
   OSM.mapUI().addTo(map);
 
+  L.control.locate({
+      position: 'topright'
+  }).addTo(map);
   L.control.scale().addTo(map);
 
   map.attributionControl.setPrefix(permalinks);