See this thread http://groups.google.com/group/Google-Maps-API/browse_thread/thread/8555280021ba1f34/c1a2abb35302c73a?hl=en#c1a2abb35302c73a
Ralph On Aug 17, 4:45 pm, "[email protected]" <[email protected]> wrote: > I have a map of all ophthalmologists in my area > at:http://www.mytbos.com/geocode/mapback.htm which uses a database to > create the xml file containing the information for the markers which > is athttp://www.mytbos.com/geocode/echoxml1.php. > > I am trying to have the user submit a form which will guide the > creation of the markers for the map. The form posts using the get > method. I then extract the variables from the form and try to pass > them to the php file that creates the file. It is not working. > > The code that extracts and passes the variabes is: > var subs = 'all'; > var insu = 'all'; > //get variable from end of url if they are there skip ? at end of > url > var query = location.search.substring(1); > > //split the rest at each & character to give a list of argname=value > pairs > var pairs = query.split("&"); > for (var i=0; i<pairs.length; i++) { > //break each pair at the first "=" to obtin the argname and > value > var pos = pairs[i].indexOf("="); > var argname = pairs[i].substring(0,pos); > var value = pairs[i].substring(pos+1); > > //process each argument name > if(argname="subs"){subs = parseFloat(value);} > if(argname="insu"){insu = parseFloat(value);}} > > and then the xml creation code is: > GDownloadUrl("echoxml.php?subspecialty="+subs+"&insurance="+insu, > function(data) { > var xml = GXml.parse(data); > var markers = xml.documentElement.getElementsByTagName > ("marker"); > for (var i = 0; i < markers.length; i++) { > var name = markers[i].getAttribute("name"); > var address = markers[i].getAttribute("address"); > var phone = markers[i].getAttribute("phone"); > var pid = markers[i].getAttribute("pid"); > var aid = markers[i].getAttribute("aid"); > var type = markers[i].getAttribute("type"); > var point = new GLatLng(parseFloat(markers[i].getAttribute > ("lat")), > parseFloat(markers[i].getAttribute > ("lng"))); > var marker = createMarker(point, name, address, phone, > pid, aid, type); > map.addOverlay(marker); > } > }); > > If you access the xml creating php file with the following > url:http://www.mytbos.com/geocode/echoxml1.php?subs=all&insu=1the file > does what it is supposed to do. All the MySQL queries have been > tested and they work properly. > > I must be making an error using the GDownloadURL function and trying > to pass variables with it. But I cannot figure out how to get it to > work. > > Thank you for any help. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
