wow i see it is working for you i'm not sure what i'm doing wrong as this is all new to me i guess it back to the drawing board for me
On Mar 23, 7:50 pm, "[email protected]" <[email protected]> wrote: > On Mar 23, 4:34 pm, "[email protected]" <[email protected]> wrote: > > > that might be true that the error go's away but so does the map and > > now it don't work at all? > > Really? This is how I "cleaned it up":http://www.geocodezip.com/User995c.html > > -- Larry > > > On Mar 23, 6:01 pm, "[email protected]" <[email protected]> > > wrote: > > > > On Mar 23, 1:31 pm, "[email protected]" <[email protected]> wrote: > > > > > well andrew here it is i can't figure it out see if you something > > > > wrong? > > > > If I clean it up, the error goes away. > > > > > <HTML> > > > > > <HEAD> > > > > <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"> > > > > <TITLE>Pilot Locator via Google Maps</TITLE> > > > > <link href="user.css" rel="stylesheet" type="text/css" /> > > > > <script type="text/javascript"> > > > > <!-- > > > > // interval for refresh > > > > var iMinutes, iSeconds; > > > > iMinutes=0; > > > > iSeconds=10; > > > > > var timerID = 0; > > > > var tStart = null; > > > > var up,down; > > > > > var min1,sec1,cmin2,csec2; > > > > > function displayTime(min,sec) { > > > > // return time in format mm:ss > > > > var disp; > > > > if(min<=9) disp=" 0"; > > > > else disp=" "; > > > > disp+=min+":"; > > > > if(sec<=9) disp+="0"+sec; > > > > else disp+=sec; > > > > return(disp); > > > > > } > > > > > function downRepeat() { > > > > // timer said: one second over > > > > csec2--; > > > > if(csec2==-1) { csec2=59; cmin2--; } > > > > document.getElementById("timeLeft").innerHTML = displayTime > > > > (cmin2,csec2); > > > > if((cmin2==0)&&(csec2==0)) > > > > timerFire(); > > > > else > > > > down=setTimeout("downRepeat()",1000) > > > > ; > > > > > } > > > > > function startTimer() { > > > > // start / init timer, page > > > > cmin2=iMinutes; > > > > csec2=iSeconds; > > > > downRepeat(); > > > > //timerAction(); // first action in maps section... > > > > > } > > > > > function restartTimer() { > > > > // start timer over with new count > > > > cmin2=iMinutes; > > > > csec2=iSeconds; > > > > downRepeat(); > > > > > } > > > > > function timerFire() { > > > > // timer said: do something now > > > > timerAction(); > > > > restartTimer(); > > > > > } > > > > > function forceRefresh() { > > > > // force refresh, reset timer > > > > timerAction(); > > > > cmin2=iMinutes; > > > > csec2=iSeconds; > > > > > } > > > > > function timerAction() { > > > > playerPositionsGet(); > > > > > } > > > > > --> > > > > </script> > > > > </HEAD> > > > > > <center><table cellpadding="2" cellspacing="0" border="0" > > > > width="100%"> > > > > <tr> > > > > > </tr> > > > > </table> > > > > </center> > > > > > <div id="map" style="width: 775px; height: 550px; border-top: 1px > > > > solid #999; border-left: 1px solid #999; border-bottom: 1px solid > > > > #505050; border-right: 1px solid #505050;"></div> > > > > <!-- text below must be keept in place --> > > > > > <!-- above text must be keept in place --> > > > > </BODY> > > > > > </HTML> > > > > > <!-- use your own Google Maps API Key - available > > > > athttp://www.google.com/apis/maps/signup.html--> > > > > <script src="http://maps.google.com/maps? > > > > file=api&v=2&key=ABQIAAAAncvRQ6bGlarUu- > > > > gJcDCGTRQi4XsiBoyVJ_BdVDKi7fJ_FcR0YRQBqJdwNntaPUK7T6wiNE6AIQu5pQ" > > > > type="text/javascript"></script> > > > > <script type="text/javascript"> > > > > //<![CDATA[ > > > > > function move_and_zoom (location) { > > > > switch (location) { > > > > case "usa": > > > > map.centerAndZoom(new GPoint(-93.867187, > > > > 38.959409), 13); > > > > break; > > > > case "swiss": > > > > map.centerAndZoom(new GPoint(7.822266, > > > > 46.626806), 9); > > > > break; > > > > case "europe": > > > > map.centerAndZoom(new GPoint(16.962891, > > > > 49.037868), 13); > > > > break; > > > > case "india": > > > > map.centerAndZoom(new GPoint(80.859375, > > > > 22.350076), 13); > > > > break; > > > > case "oceania": > > > > map.centerAndZoom(new GPoint(144.140625, > > > > -23.805450), 14); > > > > break; > > > > case "world": > > > > map.centerAndZoom(new GPoint(0, 15.741612), 15); > > > > break; > > > > default: > > > > map.centerAndZoom(new GPoint(0, 15.741612), 15); > > > > > break; > > > > } > > > > > } > > > > > function createMarker(point, lon, lat, pilotName, pilotClose, > > > > pilotAircraft, pilotAlt, pilotSpeed, pilotHeading) { > > > > var marker = new GMarker(point); > > > > GEvent.addListener(marker, "click", function() { > > > > //marker.openInfoWindowHtml('<a > > > > href="./?do=earth&coord=' + lon + > > > > ',' + lat + '">' + pilotName + ' - > > > > View in Google Earth</a>'); > > > > var sText; > > > > sText = '<b>' + pilotName + '</b> close to ' + > > > > pilotClose; > > > > sText += '<br>'; > > > > sText += 'Flying ' + pilotAircraft; > > > > sText += '<br>'; > > > > sText += 'at ' + pilotAlt + ' ft, ' + pilotSpeed + ', > > > > Heading ' + > > > > pilotHeading + ' '; > > > > marker.openInfoWindowHtml(sText); > > > > }); > > > > return marker; > > > > > } > > > > > function getPlayerData(pData, sName) { > > > > if (pData.getElementsByTagName(sName)) > > > > if (pData.getElementsByTagName(sName).item(0)) > > > > if > > > > (pData.getElementsByTagName(sName).item(0).firstChild) > > > > return > > > > pData.getElementsByTagName(sName).item(0).firstChild.data > > > > else return "" > > > > else return "" > > > > else return ""; > > > > } > > > > > function readLatLon(sWert, sPlus) { > > > > var nDegrees, nHours, nSign; > > > > var sClean; > > > > var nTemp; > > > > // cleanup > > > > // "N46° 44.61'" -> "N46 44.61'" > > > > // "E008° 7.21'" -> "E008 7.21'" > > > > // N=+, S=- // E=+, W=- > > > > sClean = sWert; > > > > sClean = sClean.replace("&#176;", ""); > > > > sClean = sClean.replace("°", ""); > > > > sClean = sClean.replace("°", ""); > > > > if (sClean.isEmpty) return 0; > > > > > //' sign... > > > > if (sClean.substr(0,1) == sPlus) nSign=1; else nSign=-1; > > > > sClean = sClean.substr(1, sClean.length-1); //rest: > > > > "NNN NN.NN" > > > > nTemp = sClean.indexOf(" "); > > > > if (nTemp>0) { > > > > // has space, looks ok > > > > nDegrees = parseFloat(sClean.substr(0,nTemp)); > > > > nHours = parseFloat(sClean.substr(nTemp, > > > > sClean.length-nTemp)); > > > > return (nDegrees + (nHours / 60.0)) * nSign ; > > > > } else return 0; > > > > } > > > > > function playerPositionsGet() { > > > > var request = GXmlHttp.create(); > > > > //request.open('GET', 'xml.xml', true); // for testing > > > > request.open('GET', '/xml', true); // when online > > > > > request.onreadystatechange = function() { > > > > if (request.readyState == 4) { > > > > map.clearOverlays(); > > > > var xmldoc = request.responseXML; > > > > var num_players = > > > > xmldoc.getElementsByTagName('CurrentPilots').item > > > > (0).firstChild.data; > > > > document.getElementById("nPilots").innerHTML = > > > > num_players; > > > > for (var i = 0; i<num_players; i++) { > > > > > var myPlayer = > > > > xmldoc.getElementsByTagName('Player').item(i); > > > > > var myLonStr = getPlayerData(myPlayer, > > > > 'Longitude'); > > > > var myLatStr = getPlayerData(myPlayer, > > > > 'Latitude'); > > > > var myLat = readLatLon(myLatStr, "N"); > > > > var myLon = readLatLon(myLonStr, "E"); > > > > if ((myLat != 0) && (myLon != 0)) { > > > > var myName = > > > > getPlayerData(myPlayer, 'Name'); > > > > var myAlt = > > > > getPlayerData(myPlayer, 'Altitude'); > > > > var myAircraft = > > > > getPlayerData(myPlayer, 'Aircraft'); > > > > var myClose = > > > > getPlayerData(myPlayer, 'NearAirport') + ' ' + > > > > getPlayerData(myPlayer, 'NearDistance'); > > > > var mySpeed = > > > > getPlayerData(myPlayer, 'Speed'); > > > > var myHeading = > > > > getPlayerData(myPlayer, > > > ... > > > read more »- Hide quoted text - > > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
