04/07/2008, 15:56
|
| | Fecha de Ingreso: marzo-2008
Mensajes: 9
Antigüedad: 16 años, 8 meses Puntos: 0 | |
Respuesta: Textfield Lo estoy hacienco con HTML y script, aqui te dejo el codigo para que le eches un vistazo se que tengo algo mal, pero nos e bien en donde lo tengo Te agradesco que me contestes Gracias
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xml:lang="es">
<head>
<title> <<<CARTOGRAFIA ESTATAL>>>
</title>
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAzqe2_AaNxwux W9d1N02v0RR4RgVUuHcRpPwJUdcbG1Iksh1AThSKnNwUf8czQy QLHT4NyJuoryYccg"
type="text/javascript"></script>
<script type="text/javascript">
var map = null;
var geocoder = null;
function load() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(32.64587951965841,-115.44536590576172), 15);
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
geocoder = new GClientGeocoder();
GEvent.addListener(map, "click",
function(marker, point) {
if (marker) {
null;
} else {
map.clearOverlays();
var marcador = new GMarker(point, {draggable: true});
map.addOverlay(marcador);
document.form_mapa.coordenadas.value = point.y;
document.form_mapa.coordenadas2.value = point.x;
}
}
);
}
}
function showAddress(address, zoom) {
if (geocoder) {
geocoder.getLatLng(address,
function(point) {
if (!point) {
alert(address + " No se encuentra");
} else {
map.setCenter(point, zoom);
var marker = new GMarker(point);
map.addOverlay(marker);
document.form_mapa.coordenadas.value = point.y+","+point.x;
}
}
);
}}
</script>
<script type="text/javascript">
function()
{
var center = map.getCenter();
document.getElementById("map").innerHTML = center.toString();
decimalLat = document.getElementById("cordenadas").innerHTML
});
var marker = new GMarker(center, {draggable: false});
GEvent.addListener(marker, "dragstart",
}
</script>
<script>
function agregar(){
var coor=document.form_mapa.coordenadas.value;
var coor1=document.form_mapa.coordenadas2.value;
document.form11.decimalLat.value=coor;
document.form11.lonDecimal.value=coor1;
}
</script>
<script type="text/javascript" language="javascript"><!--
var signlat = 1;
var signlon = 1;
var latAbs=0;
var lonAbs=0;
var deglat=' ';
var deglon=' '
--></script>
</head>
<body onLoad="load();" onunload="GUnload();">
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#336666" bgcolor="#FFFFFF">
<tr>
<td width="32%">
<h1 style="border: 1px solid #CCC;background-color: #316C6C;color: #98D1D1;font-family: verdana;"><font color="#98D1D1">CARTOGRAFIA
ESTATAL </font></h1>
<form name="form_mapa" action="#" onsubmit=" showAddress(this.address.value, this.zoom.value=parseFloat(this.zoom.value)); return false">
<p style="font-size: 10px;font-family: verdana;font-weight: bold;">Dirección
a buscar:
<input type="text" name="address" value="" style="width: 400px;font-size: 10px;font-family: verdana;font-weight: bold;" />
<input type="hidden" size="1" name="zoom" value=15 />
<input name="Submit" type="submit" value="Ver" />
</p>
<p style="font-size: 10px;font-family: verdana;font-weight: bold;">Coordenadas Longitud:
<input type="text" name="coordenadas" value="" style="width: 400px;font-size: 10px;font-family: verdana;font-weight: bold;" />
<p style="font-size: 10px;font-family: verdana;font-weight: bold;">Coordenadas Latitud:
<input type="text" name="coordenadas2" value="" style="width: 400px;font-size: 10px;font-family: verdana;font-weight: bold;" />
</p>
<p style="font-size: 10px;font-family: verdana;font-weight: bold;"> </p>
</form>
<form name="form_mapa_1" action="#" on
click=" showAddress(this.address.value, 15); return false">
<div style="width: 700px; border-width: 1px; border-style: solid; border-color: #979797; padding:8px 8px 8px 8px;">
<div id="map" style="width: 600px; height: 400px"></div>
</div>
</form>
<p style="border: 1px solid #CCC;background-color: #316C6C;color: #999;font-family: verdana;"> </p>
</td>
<td width="68%">
<form name="form11" id="form11" method="post" action="">
<table width="100%" border="7" align="center" cellpadding="0" cellspacing="0" bordercolor="#336666" bgcolor="#FFFFFF">
<tr>
<td height="348">
<p><strong><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Punto
1:</font></strong></p>
<p><strong><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
Longitud:
<input name="decimalLat" type="INT" size=25 value="" maxlength="50" id="decimalLat" style="font-size: 12pt" tabindex="11"onBlur="
if(form11.decimalLat.value < 0) { signlat = -1; }
latAbs = Math.abs( Math.round(form11.decimalLat.value * 1000000.));
//Math.round is used to eliminate the small error caused by rounding in the computer:
//e.g. 0.2 is not the same as 0.20000000000284
//Error checks
if(latAbs > (90 * 1000000)) { alert(' Grados de latitud debe estar en el rango de -90. a 90. '); form11.decimalLat.value = ''; latAbs=0; }
">
</font></strong></p>
<p><strong><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Latitud:
<input name="lonDecimal" type="INT" size=25 value="" maxlength="50" id="DegreesLon" style="font-size: 12pt" tabindex="12" onBlur="
if(form11.lonDecimal.value < 0) { signlon = -1; }
lonAbs = Math.abs(Math.round(form11.lonDecimal.value * 1000000.));
//Math.round is used to eliminate the small error caused by rounding in the computer:
//e.g. 0.2 is not the same as 0.20000000000284
//Error checks
if(lonAbs > (180 * 1000000)) { alert(' Grados de Longuitud debe estar en el rango de -180. a 180. '); form11.lonDecimal.value=''; lonAbs=0; }
">
<input type="button" name="Button" value="Agregar" onclick="agregar()" />
</font></strong></p>
<p><strong><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
</font></strong></p>
</form>
<form name="form12" id="form12" method="post" action="">
<p>Longuitud:
<input name="deglat" type="INT" size=17 value="" maxlength="17" id="deglat" style="font-size: 12pt;" tabindex='15'>
<nobr> Longitud:
<input name="deglon" type="INT" size=19 value="" maxlength="19" id="deglon" style="font-size: 12pt;" tabindex='16'>
<input name="Button2" type="button" tabindex="13"
value = 'Convertir a Grados Minutos y Secundos'
onclick ="
form12.deglat.value = ((Math.floor(latAbs / 1000000) * signlat) + '° ' + Math.floor( ((latAbs/1000000) - Math.floor(latAbs/1000000)) * 60) + '\' ' + ( Math.floor(((((latAbs/1000000) - Math.floor(latAbs/1000000)) * 60) - Math.floor(((latAbs/1000000) - Math.floor(latAbs/1000000)) * 60)) * 100000) *60/100000 ) + '"' );
form12.deglon.value = ((Math.floor(lonAbs / 1000000) * signlon) + '° ' + Math.floor( ((lonAbs/1000000) - Math.floor(lonAbs/1000000)) * 60) + '\' ' + ( Math.floor(((((lonAbs/1000000) - Math.floor(lonAbs/1000000)) * 60) - Math.floor(((lonAbs/1000000) - Math.floor(lonAbs/1000000)) * 60)) * 100000) *60/100000 ) + '"' );
signlat=1;
signlon=1;
" />
<input type="reset" value="Limpiar Campos" tabindex ="14" onClick="
form12.reset;
latAbs=0;
lonAbs=0;
"></font></strong>
</form>
</td>
</tr>
</table>
</td>
</tr>
</body>
</html> |