Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. setTimeout(function() {
  2. var map = L.map('map', {zoomControl: false}).setView([37.784173, -122.401557], 14);
  3. L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}',
  4. {
  5. attribution: 'Tiles © Esri'
  6. }).addTo(map);
  7. component.set("v.map", map);
  8. });
  9. },
  10.  
  11. accountsLoaded: function(component, event, helper) {
  12.  
  13. // Add markers
  14. var map = component.get('v.map');
  15. var accounts = event.getParam('accounts');
  16. for (var i=0; i<accounts.length; i++) {
  17. var account = accounts[i];
  18. var latLng = [account.Location__Latitude__s, account.Location__Longitude__s];
  19. L.marker(latLng, {account: account}).addTo(map);
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement