Вы находитесь на странице: 1из 5

Creas un nuevo archivo de texto con bloc de notas

Y le das un nombre y lo guardas como

Verificas que en tipo diga todos los archivos y le pones el nombre que quieras web.htm:

Pegas este código y salvas:


Código:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"


"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html>

<head>

<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<style type="text/css">

body {

font-family: Helvetica, Arial, sans-serif;

font-size:10px;

margin:0;

#content {}

</style>

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>

<script type="text/javascript">

function initialize() {

//aca muestras los dialogos donde ingresas la longitud y la latitud x y y son las coordenadas GPS
x= prompt("Ingresa valor coordenada x: 4.5980075");

y= prompt("Ingresa valor coordenada y: -74.0755334");

//se cargan las coordenadas a Google

var latlng = new google.maps.LatLng(x, y);

var settings = {

zoom: 15,

center: latlng,

mapTypeControl: true,

mapTypeControlOptions: {style:
google.maps.MapTypeControlStyle.DROPDOWN_MENU},

navigationControl: true,

navigationControlOptions: {style:
google.maps.NavigationControlStyle.SMALL},

mapTypeId: google.maps.MapTypeId.ROADMAP};

var map = new


google.maps.Map(document.getElementById("map_canvas"), settings);

var contentString = '<div id="content">'+

'<div id="siteNotice">'+

'</div>'+

'<h1 id="firstHeading" class="firstHeading">Estas


aqui...</h1>'+

'<div id="bodyContent">'+

'<p>Estas parada en este punto ;)</p>'+

'</div>'+

'</div>';

var infowindow = new google.maps.InfoWindow({

content: contentString

});
var companyImage = new
google.maps.MarkerImage('images/logo.png',

new google.maps.Size(100,50),

new google.maps.Point(0,0),

new google.maps.Point(50,50)

);

var companyShadow = new


google.maps.MarkerImage('images/logo_shadow.png',

new google.maps.Size(130,50),

new google.maps.Point(0,0),

new google.maps.Point(65, 50));

var companyPos = new google.maps.LatLng(x, y);

var companyMarker = new google.maps.Marker({

position: companyPos,

map: map,

icon: companyImage,

shadow: companyShadow,

title:"Estas aqui...",

zIndex: 3});

google.maps.event.addListener(companyMarker, 'click', function()


{

infowindow.open(map,companyMarker);

});
}

</script>

</head>

<body onload="initialize()">

<div id="map_canvas" style="width:500px; height:300px"></div>

</body>

</html>

Вам также может понравиться