views:

11

answers:

1

I want to build a Google Maps query for driving directions, but the code structure of my application requires separate fields. That is, I can't say

?saddr=100+Main+St,Anytown,PA,02154

Instead I need to say

?saddr=100+Main+St&scity=Anytown&sstate=PA&szip=02154

I can change the names of the querystring parameters, but I can't omit them.

Anybody know what Google will accept?

A: 

Google maps will ignore the parameters it doesn't recognize so you can create the address in saddr and send the other parameters too.

?saddr=100+Main+St+Anytown,+PA+02154&scity=Anytown&sstate=PA&szip=02154
Galen
Unfortunately, I can't put the city, state and zip in the address string. I can only get the four components separately, and assign each to an arbitrary querystring parameter.
Mike Kantor
What's the reason you can't change the parameters?
Galen
I'm looking for a way to do this with configuration, that doesn't require shipping new code to customers. I may be able to rearrange the fields with Javascript before submitting the form, but it would be much nicer if there were some set of parameters that Google Maps would accept.
Mike Kantor