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:
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
<div name="mapa" id="mapa" style="visibility:hidden;"></div> <script type="text/javascript">
var mapa = new GMap2(document.getElementById("mapa"));
mapa.setCenter(new GLatLng(52.4419, 16.1419), 13);
var geocoder = new GClientGeocoder();
var gmx,gmy;
var address;
function geocodeResult(results) {
if (results) {
gmx=results.lat();
gmy=results.lng();
} else {gmx=0;gmy=0;}
document.getElementById('gmx').value=gmx;
document.getElementById('gmy').value=gmy;
}
function getGeoCode()
{
address ="Poland, "+document.getElementById('miasto').value+" "+document.getElementById('gmina').value;
if (geocoder) {geocoder.getLatLng(address,geocodeResult);}
}
<td class="dodaj-left">Imię:
</td> <td><input class="long" type="text" name="miasto" onchange="getGeoCode();" /></td> <td class="dodaj-left">Imię:
</td> <td><input class="long" type="text" name="gmina" onchange="getGeoCode();" /></td> <td><input type="text" name="gmx" id="gmx" size="20" /><td> <td><input type="text" name="gmy" id="gmy" size="20" /></td>
Nie wiem co się stało. Proszę o pomoc