test





Rayon de 1km autour de votre position




 body { margin:0; padding:0; }
 #map { height:500px; }










    L.mapbox.accessToken = 'pk.eyJ1IjoiNjJhcm5vIiwiYSI6ImNrOG40aHBlbzA4NmYzZ3BpYjh4N3V6dTMifQ.cUeOPSePOhRFsXV_n0t1UA';

    //INITIALIZE MAP...
    var map = L.map('map');

    L.mapbox.styleLayer('mapbox://styles/62arno/ckfi9mnn61sjj19ry1wlrc5r5', {
    	attribution: '© OpenStreetMap contributors'
    }).addTo(map);

    // LOCATION SERVICE
    map.locate({setView: true, maxZoom: 10});
    function onLocationFound(e) {
        var radius = 20000;
         L.marker(e.latlng).addTo(map);
         L.circle(e.latlng, radius).addTo(map);

    }

    map.on('locationfound', onLocationFound);

    function onLocationError(e) {
        alert(e.message);
    }

    map.on('locationerror', onLocationError);




Leave a Comment