sorry about posting the code - here is a link to my page: http://givelocally.net/dev/map.php
On Mar 22, 3:26 pm, AM <[email protected]> wrote: > Hello, > > I did a thorough search and could not find a solution to this problem. > I also ran the page that generates the xml output for this code and it > looks fine/is returning data. I've pasted my code below. Can someone > give me a clue why the map is not showing up at all in IE or Firefox? > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > > <script src="http://maps.google.com/maps? > file=api&v=2&sensor=false&key=ABQIAAAA7yTOSAv9jG3ThsEmaYv- > IBTtL2Xy3kor62R2ptqG51oBzV9D3hT0S3NsapsR2SlvOjZgW0oDDSVX3A" > type="text/javascript"></script> > > <script type="text/javascript"> > var http = createRequestObject(); > > // Creates a marker whose info window displays the given number > function createMarker(point, html) { > var marker = new GMarker(point, baseIcon); > > GEvent.addListener(marker, "click", function() { > marker.openInfoWindowHtml(html); > > }); > > return marker; > > } > > // Open the info box for the specified marker. > function opener(i){ > //markers[i].openInfoWindowHtml( infoHtml[i] ); > ew.openOnMarker(markers[i],infoHtml[i]); > > } > > function myclick(i) { > //markers[i].openInfoWindowHtml(infoHtml[i]); > ew.openOnMarker(markers[i],infoHtml[i]); > > } > > function makeOpenerCaller( i ) > { > return function() { opener( i ); }; > > } > > function zoom(Lng, Lat) { > > if (map.getZoomLevel() != 0) { > map.centerAndZoom(new GPoint(Lng, Lat), 20); > > } > } > > function createRequestObject() { > > var req; > > if(window.XMLHttpRequest){ > // Firefox, Safari, Opera... > req = GXmlHttp.create();} else if(window.ActiveXObject) { > > // Internet Explorer 5+ > req = GXmlHttp.create();} else { > > // There is an error creating the object, > // just as an old browser is being used. > alert('There was a problem creating the GXmlHttpRequest object'); > > } > > return req; > > } > > function sendRequest() { > > var ran= Math.random()*5; > > http.open('get', 'http://www.givelocally.net/dev/GetCoords.php'); > http.onreadystatechange = onLoad; > http.send(null); > > } > > //<![CDATA[ > > // 1. Define icons > > var icon = new GIcon(); > var iconprim = new GIcon(); > iconprim.image = "http://www.google.com/mapfiles/marker.png"; > iconprim.shadow = "http://www.google.com/mapfiles/shadow50.png"; > iconprim.iconSize = new GSize(20, 34); > iconprim.shadowSize = new GSize(37, 34); > iconprim.iconAnchor = new GPoint(10, 34); > iconprim.infoWindowAnchor = new GPoint(4, 4); > > var iconattr = new GIcon(); > > iconattr.shadow = "http://www.givelocally.net/images/shadow.png"; > iconattr.iconSize = new GSize(16, 28); > iconattr.shadowSize = new GSize(40, 28); > iconattr.iconAnchor = new GPoint(6, 20); > iconattr.infoWindowAnchor = new GPoint(4, 4); > > var markers; > var infoHtml; > var map; > var side_bar_html = ""; > > function onLoad() { > > // 2. Set up panel > var panel = document.getElementById('panel'); > var CategoryCurr = ""; > var CategoryNew = ""; > var html = ""; > > // 3. Set up map > map = new GMap(document.getElementById("map")); > map.addControl(new GLargeMapControl()); > map.addControl(new GMapTypeControl()); > map.centerAndZoom(new GPoint(0.0, 0.0), 5); > > // Create an EWindow > //ew = new EWindow(map, E_STYLE_7); > //map.addOverlay(ew); > > if(http.readyState == 4 && http.status == 200){ > var xmlDoc = GXml.parse(http.responseText); > > var markerElements = > xmlDoc.documentElement.getElementsByTagName("marker"); > > markers = new Array( markerElements.length ); > infoHtml = new Array( markerElements.length ); > > for(var i = 0; i < markerElements.length; i++) { > > // get variables > var lat = > parseFloat(markerElements[i].getAttribute("lat")); > var lng = > parseFloat(markerElements[i].getAttribute("long")); > var desc = > markerElements[i].getAttribute("description"); > var type = > markerElements[i].getAttribute("type"); > var id = > markerElements[i].getAttribute("id"); > var name = > markerElements[i].getAttribute("name"); > > if (type == "1"){ > > iconattr.image = > "http://www.givelocally.net/images/ > type1.png"; > > } > > if (type == "2"){ > > iconattr.image = > "http://www.givelocally.net/images/ > type2.png"; > > } > if (type == "3"){ > > iconattr.image = > "http://www.givelocally.net/images/ > type3.png"; > > } > > // 4. Plot markers > markers[i] = new GMarker( new > GPoint( parseFloat(lng),parseFloat(lat) ), iconattr); > > GEvent.addListener( markers[i], 'click', > makeOpenerCaller(i) ); > map.addOverlay( markers[i] ); > > } > map.centerAndZoom(new GPoint(lng, lat), 6); > //document.getElementById("side_bar").innerHTML = > side_bar_html; > } > > } > > //end of map code here > > </script> > <html xmlns="http://www.w3.org/1999/xhtml" > > <link href="style.css" rel="stylesheet" type="text/css" /> > > <head> > <title>Test Map Page</title> > </head> > > <body onload="sendRequest();"> > > <div id="map"> > </div> > </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.
