Guest User

Untitled

a guest
Jan 18th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. function Inicia_Carga()
  2. {
  3. Carrega_Equipamentos(100, 0);
  4. }
  5.  
  6. function Carrega_Equipamentos(Quantidade, Pagina)
  7. {
  8.  
  9.  
  10. $.ajax({
  11. type: "GET",
  12. url: "<?php $Pivos_ANA?>",
  13. dataType: "json",
  14. success: function(){
  15.  
  16. // Criação dos pivôs ANA
  17. var Pivos_ANA_<?=$Pivos_ANA['ID']?> = new google.maps.Polygon({
  18. path: Path,
  19. position: new google.maps.LatLng(<?=$Pivos_ANA['latitude']?>,<?=$Pivos_ANA['longitude']?>,<?=$Pivos_ANA['raio']?>),
  20. draggable: false,
  21. map: Mapa,
  22. fillColor: '#A9A9A9',
  23. fillOpacity: 0.5,
  24. strokeColor: '#A9A9A9',
  25. strokeOpacity: 0.9,
  26. strokeWeight: 2,
  27. clickable: false,
  28. editable: false,
  29. draggable: false,
  30. zIndex: 1});
  31.  
  32. Map_Pivos_ANA[<?=$Pivos_ANA['ID']?>] = Pivos_ANA_<?=$Pivos_ANA['ID']?>;
  33. }
  34. });
  35. var Quantidade = <?=$Pivos_ANA?>.length;
  36.  
  37. if (Quantidade < Mapa_Pivos_ANA){
  38. Carrega_Equipamentos();
  39. }
  40.  
  41.  
  42. // Aguarda 5 segundos e executa novamente a função
  43. setTimeout(function () { Carrega_Equipamentos(Quantidade, Pagina+1) }, 5000);
  44. }
Add Comment
Please, Sign In to add comment