i'm trying to load another page into this nifty map...using maxwindow
and geturl...how do i replace my 'var maxcontent = "<center><img
src='mega_splat.jpg' height='230' width='300'/></center>" with the
external url? any ideas? Thanks!





<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml"; xmlns:v="urn:schemas-
microsoft-com:vml">

<head>
<link rel="stylesheet" type="text/css" href="include.css" />
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />


<title>Map Animation</title>

<style type="text/css">

v\:* { behavior:url(#default#VML); }

body { font-family: Verdana, Sans-serif; }

h3 { margin-left: 8px; }

#map { height: 600px;
        width: 750px;
        border: 1px solid gray;
        margin-top: 8px;
        margin-left: 8px;
        overflow: hidden;
}
.button { display: block;
        width: 180px;
        border: 1px Solid #565;
        background-color:#F5F5F5;
        margin: 10px;
        padding: 3px;
        text-decoration: none;
        text-align:center;
        font-size:smaller;
}
.button:hover {
        background-color: white;
}

#descr { position:absolute;
        top:45px;
        left: 580px;
        width: 250px;
}

.infowindow { font-size: smaller;
        text-align: left;
}

</style>


<script type="text/javascript" src="http://maps.google.com/maps?
file=api&amp;v=2&amp;key=key"></script>

</head>

<body onload="buildMap()" onunload="GUnload()">

<h3>Why?</h3>

<div id="map" style="width: 837px"> </div>


<div id="descr" style="left: 220px; top: -4px; width: 369px">
<table><tr>
<td>
<a href="#" class="button" onclick="haltAnim();return false;"
style="width: 124px">Stop Animation</a></td>
<td>
<a href="#" class="button" onclick="carryOn();return false;"
style="width: 147px">Continue Animation</a></td>
<td>
<a href="#" class="button" onclick="playAgain();return false;"
style="width: 116px">Play Again</a>
</td>
</tr></table>
</div>





<script type="text/javascript">
//<![CDATA[

// Global variables
var data = [




 { name: "his house", date: "today", lat:"34.13612",
lng:"-84.10457" },


 { name: "her house", date: "today", lat:"34.06626",
lng:"-84.0715561" }
];



var map, route;
var points = [];
var gmarkers = [];
var count =0;
var stopClick = false;


function addIcon(icon) { // Add icon attributes

 icon.shadow = "http://www.google.com/mapfiles/shadow50.png";;
 icon.shadowSize = new GSize(37, 34);
 icon.iconAnchor = new GPoint(15, 34);
 icon.infoWindowAnchor = new GPoint(19, 2);
 icon.infoShadowAnchor = new GPoint(18, 25);
}


function addClickevent(marker) { // Add a click listener to the
markers


 GEvent.addListener(marker, "click", function() {
  marker.openInfoWindowHtml(marker.content,{maxContent:
maxContent,maxTitle: maxTitle});
 });
 return marker;
}

        var maxContent = "<center><img src='mega_splat.jpg'
height='230' width='300'/></center>"
        var maxTitle = "You asked for it!";

        var maxContentDiv = document.createElement('div');
         maxContentDiv.innerHTML = 'Loading...';
                      GDownloadUrl("login.asp", function(data) {
              maxContentDiv.innerHTML = data;
            });






        var contentNode = document.createElement('div');
        contentNode.innerHTML = maxContent;
        var titleNode = document.createElement('div');
        titleNode.innerHTML = maxTitle;




function buildMap() {

 if(GBrowserIsCompatible()) {
  map = new GMap2(document.getElementById("map"));
  map.setCenter(new GLatLng(33.9743919, -84.6262741), 12);
  map.addControl(new GSmallMapControl());
  map.addControl(new GMapTypeControl());

  // Light blue marker icons
  var icon = new GIcon();
  icon.image = "http://maps.google.com/mapfiles/kml/pal3/icon56.png";;
  addIcon(icon);

  for(var i = 0; i < data.length; i++) {
   points[i] = new GLatLng(parseFloat(data[i].lat),
parseFloat(data[i].lng));
   gmarkers[i] = new GMarker(points[i], icon);

   // Store data attributes as property of gmarkers
   var html ="<div class='infowindow'><img src='http://
www.atlantanewhomesdirectory.com/images/advertisers/" +  data[i].date
+
   ".jpg' width='128' height='100' /><p><strong>"+ data[i].name + "<\/
strong><\/p><p><a href='#' class='button' onclick='haltAnim();return
false;' style='width: 124px'>Stop Animation</a><\/p><p><a
href='javascript:map.getInfoWindow().maximize()'>View Details</a><\/
p><p>" +
   data[i].date + "<\/p><\/div>";
   gmarkers[i].content = html;
   addClickevent(gmarkers[i]);
   map.addOverlay(gmarkers[i]);


  }

  // Open infowindow of first marker
  gmarkers[0].openInfoWindowHtml( gmarkers[0].content,
{maxContent: contentNode,maxTitle: titleNode});

  route =setTimeout("anim()", 7000);
 }
}


function haltAnim() {

 if(route) {
  clearTimeout(route);
  stopClick = true;
 }
}


function carryOn() {

 if(stopClick == true) anim();
 stopClick = false;
}


function anim() {

 count++;
 if(count < points.length) {
  map.panTo(points[count]);
  gmarkers[count].openInfoWindowHtml( gmarkers[count].content,
{maxContent: contentNode,maxTitle: titleNode});
  var delay = 10000;
  if((count+1) != points.length)
   var dist = points[count].distanceFrom(points[count+1]);

  // Adjust delay
  if( dist < 10000 ) {
   delay = 7000;
  }
  if( dist > 80000 ) {
   delay = 7000;
     }
  route = setTimeout("anim()", delay);
 }
  else {
  clearTimeout(route);
  count = 0;
  route = null;
 }
}


function playAgain() {

 GUnload();
 if(route) clearTimeout(route);
 stopClick = false;
 count = 0;
 buildMap();
}

//]]>
</script>


</body>
</html>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to