Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var marker =[];
- var markerarray =[];
- var newcoordinate=[];
- var coordinates=[];
- var myLatlng = new google.maps.LatLng(3.3950644,-76.525664);
- var mapOptions = {
- zoom: 13,
- center: myLatlng
- }
- var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
- setInterval(function(){
- $.ajax({
- type: "get",
- url: "marks.php",
- success: function(data){
- var split = data.split(',');
- var parada = split[2];
- var busname = split[3];
- coordinates = (split[0]+','+split[1]);
- newcoordinate = new google.maps.LatLng(coordinates.split(",")[0],coordinates.split(",")[1]);
- marker = new MarkerWithLabel({
- map:map,
- });
- marker.setPosition(newcoordinate);
- }
- });
- },2000);
- $query = "
- SELECT DISTINCT MAX ( OP.TELEGRAMDATE), B.BUSNUMBER,OP.Stopid, OP.GPSX,OP.GPSY,L.SHORTNAME
- FROM Sgco.OPERATIONALINFO OP, sgco.LINES L, sgco.BUSES B
- WHERE L.PLANVERSIONID = (select max(p.planversionid) from sgco.planversions p
- where PLANVERSIONID NOT IN ('9001', '9000')
- and p.activationdate <= to_date('01-06-2015')
- and B.PLANVERSIONID = L.PLANVERSIONID )
- AND L.LINEID = OP.LINEID
- AND OP.LINEID = (SELECT lineid FROM sgco.lines
- WHERE SHORTNAME = UPPER ('A77')
- AND planversionid = L.PLANVERSIONID)
- AND B.BUSID = OP.BUSNUMBER
- GROUP BY TELEGRAMDATE, B.BUSNUMBER,Stopid,GPSX,GPSY,SHORTNAME
- ";
- $result = oci_parse($connect, $query);
- oci_execute($result);
- $i=0;
- while (($row = oci_fetch_array($result, OCI_BOTH)) != false)
- {
- $datosq [$i][0]=$row[0].'1<br>';//fecha
- $datosq [$i][1]=$row[1].'2<br>';//numbus
- $datosq [$i][2]=$row[2].'3<br>';//stopid
- $datosq [$i][3]=$row[3].'4<br>';//long
- $datosq [$i][4]=$row[4].'5<br>';//lat
- $row[4] = preg_replace('/3/','3.',$row[4],1);
- $row[3] = preg_replace('/-76/','-76.',$row[3],1);
- /*echo '<script>alert ('.$row[2].')</script>';*/
- $conImagen=$i+1;
- echo $row[4].','.$row[3].','.$row[2].','.$row[1].',';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement