I'm sure im missing a semicolon or something somewhere but i cannot seem to get my markers to show up on the map.
I am pulling from a database into an xml file and then taking the markers from that. the creation of the xml file is working but i think the problem lies somewhere in my markup to create the markers. link to working xml: http://dealsatyourdoor.com/cleantest/newcreatxml.php?metro=omaha&mapid=2 link to broken map page: http://dealsatyourdoor.com/cleantest/mainmap.php?mapid=2&metro=omaha And finally the code: function load() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("googmap")); map.addControl(new GLargeMapControl3D()); //makes the nice slider on the left for moving about map.addControl(new GMapTypeControl()); //This adds the map, satellite, hybrid section to the top left map.addControl(new GScaleControl());//places the scale at the bottom left map.setCenter(new GLatLng(<?php echo $center;?>), 11); // center of omaha GDownloadUrl("newcreatxml.php?metro=omaha&mapid=2", function(data) { var xml = GXml.parse(data); var markers = xml.documentElement.getElementsByTagName("marker"); for (var i = 0; i < markers.length; i++) { var locid = markers[i].getAttribute("locid"); var name = markers[i].getAttribute("name"); var add1 = markers[i].getAttribute("add1"); var add2 = markers[i].getAttribute("add2"); var city = markers[i].getAttribute("city"); var state = markers[i].getAttribute("state"); var zip = markers[i].getAttribute("zip"); var phone = markers[i].getAttribute("phone"); var lat = markers[i].getAttribute("lat"); var lng = markers[i].getAttribute("lng"); var logo = markers[i].getAttribute("logo"); var weekhrs = markers[i].getAttribute("weekhrs"); var sathrs = markers[i].getAttribute("sathrs"); var sunhrs = markers[i].getAttribute("sunhrs"); var daydurl = markers[i].getAttribute("daydurl"); var pin = markers[i].getAttribute("pin"); var point = new GLatLng(parseFloat(markers[i].getAttribute ("lat")), parseFloat(markers[i].getAttribute("lng"))); var marker = createMarker(point, locid, name, add1, add2, city, state, zip, phone, lat, lng, logo, weekhrs, sathrs, sunhrs, daydurl, pin); map.addOverlay(marker); } }); } } function createMarker(point, locid, name, add1, add2, city, state, zip, phone, lat, lng, logo, weekhrs, sathrs, sunhrs, daydurl, pin){ var marker = new GMarker(point, {icon:customIcons[pin], title:name}); //passes the pin variable into the custom icon thing above to give us the pin var hours = 'M-F: ' +weekhrs+ '<br />Sat: '+sathrs+'<br / >Sun :'+sunhrs; var html = <?php include 'coupon-bubble.php'; ?>; //this MUST be all in one line. var html2 = <?php include 'listing-bubble.php'; ?>; //this MUST be all in one line. GEvent.addListener(marker, 'click', function() { if (pin > '0'){ marker.openInfoWindowHtml(html); } else{ marker.openInfoWindowHtml(html2); } }); return marker; } --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
