**********************************************
********** CODIGO *************************
**********************************************
IF vrevend.locx = 0
RETU
ENDIF
IF vrevend.locy = 0
RETU
ENDIF
TEXT TO lcHtml NOSHOW TEXTMERGE
<html> <head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Geolocalizacion</title>
<script src="http://maps.google.com/maps?file=api&v=2&key=123" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
function load()
{ if (GBrowserIsCompatible())
{ var map = new GMap2(document.getElementById("map"),G_SATELLITE_MAP);
map.addMapType(G_SATELLITE_3D_MAP);
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.addControl(new GOverviewMapControl());
map.setCenter(new GLatLng(<<ALLTRIM(STR(vrevend.locx,18,14))>>, <<ALLTRIM(STR(vrevend.locy,18,14))>>),<<TRANSFORM(17)>>) ;
map.setMapType(G_HYBRID_MAP);
var point = new GLatLng(<<ALLTRIM(STR(vrevend.locx,18,14))>>, <<ALLTRIM(STR(vrevend.locy,18,14))>>);
var marker = new GMarker(point);
map.addOverlay(marker);
// Globo de informacion
marker.openInfoWindowHtml("Lat: " + point.y + " Long: " + point.x + "<br>" + "<<ALLTRIM(vrevend.nombre)>>" + "<br>" + "<<ALLTRIM(vrevend.direc)>>");
GEvent.addListener(map, "click", function (overlay,point)
{if (point)
{marker.setPoint(point);
var myHtml = "Lat: " + point.y + " Long: " + point.x + "<br>" + " <<ALLTRIM(vrevend.nombre)>>" + "<br>" + "<<ALLTRIM(vrevend.direc)>>" ;
map.openInfoWindow(point, myHtml);
document.getElementById("latitude").innerHTML = point.y;
document.getElementById("longitude").innerHTML = point.x;
} } ) ;
} }
//]]> </script> </head>
<body scroll="no" bgcolor="#CCCCCC" topmargin="0" leftmargin="0"
onload="load()" onunload="GUnload()">
<div id="map" style="width:757px;height:473px"></div>
<div id="latitude"></div>
<div id="longitude"></div>
</body> </html>
ENDTEXT
STRTOFILE(lcHtml,"MiHtml.htm")
ThisForm.PGFPAGEFRAME.Page3.Olecontrol1.NAVigate2(FULLPATH("MiHtml.htm"))
* THISFORM.oleIE.Navigate2(FULLPATH("MiHtml.htm"))
* var myHtml = "Lat: " + point.y + " Long: " + point.x + CHR(12) + <<ALLTRIM(vrevend.nombre)>> + CHR(12) + <<ALLTRIM(vrevend.direc)>> ;
**********************************************
para obtener los valores de las variables creadas dentro del codigo html
cLatitud = This.parent.Olecontrol1.document.getElementById("latitude").innerHTML
cLongitud = This.parent.Olecontrol1.document.getElementById("longitude").innerHTML
* MESSAGEBOX("Latitud : " + cLatitud + CHR(13) + "Longitud : " + cLongitud)
This.parent.TXTLOCX.value = VAL(cLongitud)
This.parent.TXTLOCY.value = VAL(cLatitud)
This.parent.parent.Page1.TXTID.InteractiveChange
This.parent.TXTLOCX.Refresh
This.parent.TXTLOCY.Refresh