Now I am just very confused... My new updated code is still not working but i am so lost at this point i really dont know what to say... <!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> <meta http-equiv="content-type" content="text/html; charset=utf-8"/ > <title>Riding Areas</title> <script src="http://maps.google.com/maps? file=api&v=2&key=ABQIAAAAK4SdEypaHKfm0OPMRZISEBT42Onpw_fGX3cH9SE- hTsrnh--IRTwTULoB9lf7RRc-Nlg-yV_cJGdMw" type="text/javascript"></ script> <script src="http://gmaps-utility-library.googlecode.com/svn/trunk/ markermanager/release/src/markermanager.js"></script>
<script> var map; function initialize () { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById("map_canvas")); map.enableScrollWheelZoom(); map.setCenter(new GLatLng(39.504041,-99.492187), 5); map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); map.addMapType(G_PHYSICAL_MAP); map.setMapType(G_HYBRID_MAP); addMarkersFromXML(); var myIcon = new GIcon(G_DEFAULT_ICON); myIcon.image = 'markers/image.png'; myIcon.shadow = 'markers/shadow.png'; myIcon.iconSize = new GSize(32,32); myIcon.shadowSize = new GSize(48,32); myIcon.iconAnchor = new GPoint(16,32); myIcon.infoWindowAnchor = new GPoint(16,0); myIcon.printImage = 'markers/printImage.gif'; myIcon.mozPrintImage = 'markers/mozPrintImage.gif'; myIcon.printShadow = 'markers/printShadow.gif'; myIcon.transparent = 'markers/transparent.png'; myIcon.imageMap = [31,0,31,1,31,2,31,3,31,4,31,5,31,6,31,7,31,8,31,9,31,10,31,11,31,12,31,13,31,14,31,15,31,16,31,17, 31,18,31,19,31,20,31,21,31,22,31,23,31,24,31,25,31,26,31,27,31,28,31,29,31,30,31,31,0,31,0,30,0,29,0,28,0,27,0,26,0,25,0,24,0,23,0,22,0,21,0,20,0,19,0,18,0,17,0,16,0,15,0,14,0,13,0,12,0,11,0,10,0,9,0,8,0,7,0,6,0,5,0,4,0,3,0,2,0,1,0,0]; // An array of GIcons, to make the selection easier var icons = []; icons[1] = myIcon; var markerOptions = { icon:myIcon } ; } } function addMarkersFromXML(){ var batch = []; mgr = new MarkerManager(map); var request = GXmlHttp.create(); request.open('GET', 'ridingarea1.xml', true); request.onreadystatechange = function() { if (request.readyState == 4 && request.status == 200) { var xmlDoc = request.responseXML; var xmlrows = xmlDoc.documentElement.getElementsByTagName("Row"); for (var i = 0; i < xmlrows.length; i++) { var xmlrow = xmlrows[i]; var xmlcellLongitude = xmlrow.getElementsByTagName("Longitude")[0]; var xmlcellLatitude = xmlrow.getElementsByTagName("Latitude")[0]; var point = new GLatLng(parseFloat (xmlcellLatitude.firstChild.data), parseFloat (xmlcellLongitude.firstChild.data)); //get the building name var xmlcellRidingArea = xmlrow.getElementsByTagName("Riding_Area") [0]; var celltextRidingArea = xmlcellRidingArea.firstChild.data; //get the address var xmlcellAddress = xmlrow.getElementsByTagName("Address")[0]; var celltextAddress = xmlcellAddress.firstChild.data; //get the ownership var xmlcellOwnership = xmlrow.getElementsByTagName("Ownership")[0]; var celltextOwnership = xmlcellOwnership.firstChild.data; //get the date built var xmlcellDateBuilt = xmlrow.getElementsByTagName("Date_Built") [0]; var celltextDateBuilt = xmlcellDateBuilt.firstChild.data; var icontype = parseInt(markers[i].getAttribute("icontype")); var htmlString = "Riding Area: " + celltextRidingArea + "<br>" + "Address: " + celltextAddress + "<br>" + "Ownership: " + celltextOwnership + "<br>" + "More Info: " + celltextDateBuilt; //var htmlString = 'yes' var marker = createMarker (point,htmlString,icontype); batch.push(marker); } mgr.addMarkers(batch,5); mgr.refresh(); } } request.send(null); } function createMarker(point,html,icontype) { var marker = new GMarker(point,icons[icontype]); GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); map.addOverlay(marker); } </script> </head> <body onload="initialize()" onunload="GUnload()"> <div id="map_canvas" style="width: 1350px; height: 800px"></div> <div id="message"></div> </body> </html> You can view that there is no marker shown http://www.mototips.com/sample/sample.html http://www.mototips.com/sample/ << shows a marker just not the custom one... But the sample.html code has come much further then this orginal.... I need this explained to me like i am a newbie. Thank you every one for your help so far and your help in the future. Look forward to hearing from you all :) On Jun 10, 11:42 pm, Mike Williams <nos...@econym.demon.co.uk> wrote: > You have two functions with the same name. The one that actually gets > executed (in Firefox) is this one: > > function createMarker(point,html) { > var marker = new GMarker(point); > GEvent.addListener(marker, "click", function() { > marker.openInfoWindowHtml(html); > }); > return marker; > } > > Note also that your other createMarker function expects to be passed > three arguments, and it doesn't return a reference to the marker, and > it's out of scope when you make the call > var marker = createMarker(point,htmlString); > > -- > Mike Williamshttp://econym.org.uk/gmap --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to Google-Maps-API@googlegroups.com To unsubscribe from this group, send email to google-maps-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---