Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Pobieranie współrzędnych za pomocą google maps.
szczalpi
post
Post #1





Grupa: Zarejestrowani
Postów: 336
Pomógł: 0
Dołączył: 25.10.2006

Ostrzeżenie: (10%)
X----


Witam
Mam problem z pobieraniem współrżednych za pomocą google maps. Wcześniej działało, a teraz lipa :/
Poniżej podaje mój kod:
  1. <head>
  2.  
  3. <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
  4. </head>
  5.  
  6. <div name="mapa" id="mapa" style="visibility:hidden;"></div>
  7. <script type="text/javascript">
  8.  
  9. var mapa = new GMap2(document.getElementById("mapa"));
  10. mapa.setCenter(new GLatLng(52.4419, 16.1419), 13);
  11.  
  12. var geocoder = new GClientGeocoder();
  13. var gmx,gmy;
  14. var address;
  15.  
  16. function geocodeResult(results) {
  17. if (results) {
  18. gmx=results.lat();
  19. gmy=results.lng();
  20. } else {gmx=0;gmy=0;}
  21. document.getElementById('gmx').value=gmx;
  22. document.getElementById('gmy').value=gmy;
  23. }
  24.  
  25. function getGeoCode()
  26. {
  27. address ="Poland, "+document.getElementById('miasto').value+" "+document.getElementById('gmina').value;
  28. if (geocoder) {geocoder.getLatLng(address,geocodeResult);}
  29. }
  30.  
  31.  
  32. <tr>
  33. <td class="dodaj-left">Imię:</td>
  34. <td><input class="long" type="text" name="miasto" onchange="getGeoCode();" /></td>
  35. </tr><tr>
  36. <td class="dodaj-left">Imię:</td>
  37. <td><input class="long" type="text" name="gmina" onchange="getGeoCode();" /></td>
  38. </tr>
  39. <tr>
  40. <td><input type="text" name="gmx" id="gmx" size="20" /><td>
  41. <td><input type="text" name="gmy" id="gmy" size="20" /></td>
  42. </tr>



Nie wiem co się stało. Proszę o pomoc


--------------------
Nieregulaminowa stopka usunieta
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 20.08.2025 - 21:12