Having Problems with Leaflet Mobile

33 views
Skip to first unread message

FoughtWon

unread,
May 9, 2015, 5:18:31 PM5/9/15
to leafl...@googlegroups.com
So this is my code, where did I go wrong experts?

<!DOCTYPE HTML>
<html>
<head>
   
<title>Mobile</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /
>  
   
<link rel="stylesheet" href="leaflet.css" />
<script src="leaflet-src.js"></script>  
<style>
body
{
    padding
:0;
    margin
:0;
}
   
#map {
 height
: 100%;
}
</style>
</
head>
 
<body>
   
<div id="map"></div>
<script>
 
var map = L.map('map');


L
.tileLayer('http://{s}.tiles.mapbox.com/v3/MapID/997/256/{z}/{x}/{y}.png', {
    maxZoom
: 18,
    attribution
: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>',
}).addTo(map);
   
function onLocationFound(e) {
   
var radius = e.accuracy / 2;


    L
.marker(e.latlng).addTo(map)
       
.bindPopup("You are within " + radius + " meters from this point").openPopup();


    L
.circle(e.latlng, radius).addTo(map);
}


   
function onLocationError(e) {
    alert
(e.message);
}
    map
.on('locationfound',onLocationFound);
    map
.on('locationerror', onLocationError);
   
map
.locate({setView: true, maxZoom: 16});
};
</script>
</
body>
</html>




FoughtWon

unread,
May 9, 2015, 5:53:22 PM5/9/15
to leafl...@googlegroups.com
NVM problem fixed, Thanks!
Reply all
Reply to author
Forward
0 new messages