Guest User

Untitled

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