Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- var map = new L.map('map');
- L.tileLayer('http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png', {
- maxZoom: 18,
- attribution: 'Map data © <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://cloudmade.com">CloudMade</a>'
- }).addTo(map);
- var markerLayer = new L.featureGroup();
- givePoint(lat, lon){
- var latlng = new L.LatLng(lat,lon);
- marker = new L.marker(latlng, {icon: myIcon});
- marker.addTo(markerLayer);
- markerLayer.addTo(map);
- var bounds = markerLayer.getBounds();
- map.fitBounds(bounds);
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement