sombriks

Untitled

Jun 9th, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. var map = L.map('map', {
  3.   'center': [-3.74461, -38.5742],
  4.   'zoom': 15
  5. });
  6.  
  7. var tileLayer = L.tileLayer('https://{s}.tiles.mapbox.com/v4/{mapId}/{z}/{x}/{y}.png?access_token={token}', {
  8.   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>',
  9.   subdomains: ['a','b','c','d'],
  10.   mapId: 'rakshak.l937n12c',
  11.   token: 'pk.eyJ1IjoicmFrc2hhayIsImEiOiJ5cHhqeHlRIn0.Vi87VjI1cKbl1lhOn95Lpw'
  12. });
  13.  
  14. tileLayer.addTo(map);
  15.  
  16. var pointA = new L.LatLng(-3.74166, -38.53532);
  17. var pointB = new L.LatLng(-3.74461, -38.5742);
  18.  
  19. var marker = L.marker(pointA).addTo(map);
  20.  
  21. var pointList = [pointA, pointB];
  22.  
  23. // map.center.setTo(pointB);
  24.  
  25. var firstpolyline = new L.Polyline(pointList, {
  26.     color: 'blue',
  27.     weight: 3,
  28.     opacity: 0.5,
  29.     smoothFactor: 1
  30. });
  31. firstpolyline.addTo(map);
Advertisement
Add Comment
Please, Sign In to add comment