Advertisement
rossig7

custom icon

Nov 2nd, 2014
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var officeIcon = L.icon({
  2.     iconUrl: 'iconoffice.png',      
  3.     iconSize:     [32,32], // size of the icon    
  4.     iconAnchor:   [20,32], // point of the icon which will correspond to marker's location
  5.     popupAnchor:  [0,-18], // point from which the popup should open relative to the iconAnchor    
  6.     shadowUrl: 'bikeiconshadow.png',    
  7.     shadowSize:   [40,32], // size of the shadow
  8.     shadowAnchor: [4,62]  // the same for the shadow    
  9. });
  10.  
  11. function cargarMarkers()
  12. {      
  13.         paradas_ant = paradas.slice();
  14.             for(var i = 0; i < paradas.length;i++)
  15.             {
  16.                 parada = paradas[i];
  17.                
  18.                 var lat = parseFloat(parada[1]);
  19.                 var lng = parseFloat(parada[2]);
  20.                                                        
  21.                 if (parada[4] == -1)
  22.                 {
  23.                    
  24.                     desc = "<b><centre>" + parada[0] + "</centre></b>" + "<br>" +
  25.                     "Calle Alzáibar 1321" + "<br>" +
  26.                     "Lunes a Viernes: 9:00 a 18:00 hs. Sábados: 10:00 a 14:00 hs";                                                
  27.                     marker = L.marker([lat,lng], {icon: officeIcon, title: 'Oficina central'}).addTo(mapa).bindPopup(desc);                                    
  28.                 }                                          
  29.             }
  30. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement