On Apr 11, 10:35 pm, Aaron <[email protected]> wrote:
> I'm using the store locator tutorial code and it works fine. I'm
> trying to add an additional URL parameter to be sent to the PHP page
> that generates the xml. The part of the script that constructs the
> URL is here:
>
> var searchUrl = 'phpsqlsearch_genxml.php?lat=' + center.lat() +
> '&lng=' + center.lng() + '&radius=' + radius;
>
> I need to send an additional "sort" parameter so the XML results will
> be sorted by name or distance. I created an additional input field in
> the html and tried adding this to the script that constructs the URL:
>
> var searchUrl = 'phpsqlsearch_genxml.php?lat=' + center.lat() +
> '&lng=' + center.lng() + '&radius=' + radius + '&sort=' + sort;
>
> It doesnt work
>
> When I hard code the parameter like the following, it works fine.
>
> var searchUrl = 'phpsqlsearch_genxml.php?lat=' + center.lat() +
> '&lng=' + center.lng() + '&radius=' + radius + '&sort=name';
>
> -OR-
>
> var searchUrl = 'phpsqlsearch_genxml.php?lat=' + center.lat() +
> '&lng=' + center.lng() + '&radius=' + radius + '&sort=distance';
>
> so there is nothing wrong with the database or the xml or any of that.
> The error is that the field value is not being passed to the URL
> parameter.
Not a maps question.
Your searchLocationsNear() function doesn't attempt to read the sort
value from the HTML form at all.
You need to read the value from an HTML element in a similar way as
you read the radius variable.
And then substitute it in the URL string where you have &sort=name
hardcoded.
> Here is a link to the html
> page:http://www.realestatefinance.com/bankfinder/Locator.html
Have you looked at the javascript errors on that page? You'll want to
load dragzoom.js AFTER the maps API
cheers, Ross K
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---