Foros del Web » Creando para Internet » Diseño web »

Textfield

Estas en el tema de Textfield en el foro de Diseño web en Foros del Web. Hola: Tengo problemas con los textfield, estos haciendo una pagina de internet en donde aparece un mapa k al darle click en un cierto punto ...
  #1 (permalink)  
Antiguo 04/07/2008, 10:03
 
Fecha de Ingreso: marzo-2008
Mensajes: 9
Antigüedad: 16 años, 1 mes
Puntos: 0
Textfield

Hola:

Tengo problemas con los textfield, estos haciendo una pagina de internet en donde aparece un mapa k al darle click en un cierto punto aparece un marcador y me aparecen las coordenadas en dos textfield(lo llamare textfield1) uno para la log y lat, despues de ai si las coordenadas son las deseadas, deberas de dar click al boton de agregar para que se guarde ese punto en otro textfiel(textfield2).
Las coordenadas me las da en coordenadas cartesianas pero trae la opcionde pasarlas a coordenadas geograficas con darle click a un boton de convertir, pero no me toma lo del textfield2, sino que tengo que darle click a los textfield(me refiero dentro de ellos) como para que reconosca que hay algo, sino solo me aparecen ceros...

Espero que entiendan y me pueden ayudar
Gracias
  #2 (permalink)  
Antiguo 04/07/2008, 12:17
Avatar de tunait
Moderadora
 
Fecha de Ingreso: agosto-2001
Ubicación: Terok Nor
Mensajes: 16.805
Antigüedad: 22 años, 8 meses
Puntos: 381
Respuesta: Textfield

Qué tal cachana,

lo que estás haciendo ... ¿cómo está hecho? con html y javascript o tal vez con flash?

un saludo
  #3 (permalink)  
Antiguo 04/07/2008, 15:56
 
Fecha de Ingreso: marzo-2008
Mensajes: 9
Antigüedad: 16 años, 1 mes
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&amp;v=2&amp;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;">&nbsp; </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;">&nbsp;</p>

&nbsp;</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">&nbsp;
<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>&nbsp; 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) + '&deg; ' + 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 ) + '&quot;' );
form12.deglon.value = ((Math.floor(lonAbs / 1000000) * signlon) + '&deg; ' + 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 ) + '&quot;' );
signlat=1;
signlon=1;

" />
&nbsp; &nbsp;
<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>
  #4 (permalink)  
Antiguo 04/07/2008, 15:58
 
Fecha de Ingreso: marzo-2008
Mensajes: 9
Antigüedad: 16 años, 1 mes
Puntos: 0
Respuesta: Textfield

Se me olvidaba se tiene que cambiar la llave en el script

<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAzqe2_AaNxwux W9d1N02v0RR4RgVUuHcRpPwJUdcbG1Iksh1AThSKnNwUf8czQy QLHT4NyJuoryYccg"


en esta linea es donde se tiene que cambiar se baja de google map
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:00.