Hi all,

I posted a similar message a couple of weeks ago re: www.thelokator.com
and why the map wasn't displaying the markers after deploying being
deployed. The "searchLocations()" function is activated by the Flash
interface once the Update button is clicked. The PHP script
(www.thelokator.com/generateXMLfromSQL.php) correctly grabs the values
from the database effectively, so I'm pretty sure it's the javascript
code in my index.php page that is problematic. If someone could take a
quick look to see if there's a reason why my markers aren't being
generated, then that would be great.

Thanks!


***** index.php page ****

<script language="JavaScript" type="text/JavaScript">
//<![CDATA[


var map;


function load() {


// Check to see if this browser can run the Google API
if (GBrowserIsCompatible()) {


map = new GMap2(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.addControl(new GScaleControl());
map.setCenter(new GLatLng(-25.274398, 133.775136), 4);



}


// display a warning if the browser was not compatible
    else {
      alert("Sorry, the Google Maps API is not compatible with this
browser");
    }


}


// activated by Flash console when button is pressed

function searchLocations() {


         var searchUrl = 'generateXMLfromSQL.php';
         GDownloadUrl(searchUrl, function(data) {


           var xml = GXml.parse(data);
           var markers =
xml.documentElement.getElementsByTagName("marker");
        map.clearOverlays();
        var bounds = new GLatLngBounds();
        for (var i = 0; i < markers.length; i++) {


         var point = new
GLatLng(parseFloat(markers[i].getAttribute("lat")),
parseFloat(markers[i].getAttribute("lng")));
         var user = markers[i].getAttribute("user");
         var date = markers[i].getAttribute("date");
         var time = markers[i].getAttribute("time");
         var type = markers[i].getAttribute("type");
         var title = markers[i].getAttribute("title");
         var message = markers[i].getAttribute("message");
         var timeTag = markers[i].getAttribute("postid");
         var locationTag = markers[i].getAttribute("image");
         var marker = createMarker(point, user, date, time, type,
title, message, postid, image);
         map.addOverlay(marker);
         bounds.extend(point);


       }
       map.setCenter(bounds.getCenter(),
map.getBoundsZoomLevel(bounds));
     });


   }


function createMarker(point, user, date, time, type, title, message,
postid, image) {
  marker = new GMarker(point);
  GEvent.addListener(marker, "click", function() {


             var html = "<div class=\"bubble\">" +
             "<div class=\"content\">" +
             "<table width='100%' border='0' cellspacing='0'
cellpadding='0'>" +
             "<tr><td width='100%' align='left' valign='top'>" +
             "<div class=\"firstRow\"><strong>User: <div class=\"user
\">" + user + "</div></strong></div>" +
             "<div class=\"rows\"><strong>Date: </strong>" + date +
"</
div>" +
             "<div class=\"rows\"><strong>Time: </strong>" + time +
"</
div>" +
             "<div class=\"rows\"><strong>Type: </strong>" + type +
"</
div></div></td>" +
             "<td align='right' valign='top'>" +
             "<div class=\"image\"><img src='" + image + "' alt='User
Image' width='60px' height='60px'/></div></td></tr>" +
             "<tr><td colspan='2' align='left' valign='bottom'><div
class=\"link\">" +
             "<div class=\"envelope\"><a href='account_send.php?
user="
+ user + "'><img src='images/envelope.gif' alt='Message Me'
width='16px' height='10px'/></a></div>" +
             "<a href='favourites.php?post=" + postid + "'><img
src='images/heart.png' alt='Add to Favourites' width='13px'
height='11px'/></a></div>" +
             "<div class=\"title\"><strong>" + title + "</strong></
div>" +
             "<div class=\"message\">" + message + "</div></td></
tr></
table></div></div>";


              marker.openInfoWindow(html);
            });
    return marker;



}


//]]>
</script></head>

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


...............


<!-- the map will be displayed here -->


<div id="map" style="width: 597px; height: 400px">

--~--~---------~--~----~------------~-------~--~----~
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