0

The leaflet documentation tells me that you should use the maxZoom option on location but it's not working (http://leafletjs.com/reference.html#map-locate-options). When a user is using geolocation on my site and finds their position at the map it zooms in too much and I want to regulate this myself. Does anyone have a quick fix?

J. Sveum
  • 29
  • 1
  • 7

1 Answers1

0

in your main.js you have to set a locate option in this section

   if (!navigator.geolocation) {
        geolocate.innerHTML = 'Geolocation is not available';
    } else {
        geolocate.onclick = function (e) {
            var tl = new TimelineMax({repeat:2});   
            tl.to("svg.pointwhite", .10, {transformOrigin: "50% 100%", scaleY:0.25, yoyo:true, repeat:1})
              .to("svg.pointwhite", .65, {y:-6, ease:Circ.easeOut, yoyo:true, repeat:1});                   
            e.preventDefault();
            e.stopPropagation();
            map.locate({ maxZoom: 12}); // locate option goes here       
        };
    }     
YaFred
  • 9,698
  • 3
  • 28
  • 40