Click to See Complete Forum and Search --> : javascript city map


jeffda
06-25-2003, 05:58 PM
I need to have a map of a particular city that will allow the user to put in their street address and the javascript will find it on the map then show them where the building is. This website is for a church and the map needs to show them where the church is after it shows them where they live. Now I know that this will probably be a very large script, but right now I don't really care.

Khalid Ali
06-25-2003, 07:20 PM
I'd doubt if you can do such a thing with javascript only.

Khalid Ali
06-25-2003, 09:44 PM
Theoretically ...yes ofcourse it can be done..however,an applicatiopn of such kind I have not seen been done in JS,Id love to see an example if there is any...

pyro
06-25-2003, 11:05 PM
Dave-

I'm not sure that is what the original poster wanted, or what Khalid was thinking of. It certainly wasn't what I was thinking...

Originally posted by jeffda
I need to have a map of a particular city that will allow the user to put in their street address and the javascript will find it on the map then show them where the building is. This website is for a church and the map needs to show them where the church is after it shows them where they live. Now I know that this will probably be a very large script, but right now I don't really care.

Khalid Ali
06-26-2003, 12:10 AM
Thanks Pyro,Thanks Dave.
I appreciate the effort Dave,however,do you really think if javascript was up for a task like this then "Aut*****" would use any other programming languge but JS?
I think problem here is misunderstanding(???).
This is what I thought the original poster wanted.
Something along the lines of a mapquest or yahoo map display.dAn that can not be done in JS...several years back I worked on a project that would use VML to display maps..some one wanted to corner aut***** with that???...Believe me its no small task to create an app like that.( I still have a working example of it..:p )
But who knows I might have understood the question incorrectly all along..:D

Cheers friends.

pyro
06-26-2003, 07:50 AM
Originally posted by Dave Clark
All I was doing was defining what JavaScript can do...Sorry. Didn't mean to step on any toes. To me, it just didn't seem like a job for javascript, that's all I was trying to point out. :)

Cheers!

Vladdy
06-26-2003, 08:56 AM
You want to give your site visitors driving directions to a certain location. Why invent a javascript when the following will be way more practical - just change church address and leave "Your address" fields empty (I put some values there for test/demo):


<form name="ddForm" action="http://www.mapquest.com/directions/main.adp" method="get">
<input type="hidden" name="go" value="1">
<input type="hidden" name="do" value="nw">
<input type="hidden" name="ct" value="NA">
<fieldset><legend>Your Address</legend>
<input type="hidden" name="1y" value="US">
<label>Street: <input type="text" name="1a" size="50" maxlength="80" value="12 N 7th St" /></label>
<label>City: <input type="text" name="1c" size="11" maxlength="80" value="Terre Haute" /></label>
<label>State: <input type="text" name="1s" maxlength="2" size="1" value="IN" /></label>
<label>Zip: <input type="text" name="1z" size="6" maxlength="10" value="47807">
</fieldset>

<fieldset><legend>Church Address</legend>
<input type="hidden" name="2y" value="US">
<label>Street: <input readonly="readonly" type="text" name="2a" size="50" maxlength="80" value="245 S 3rd St" /></label>
<label>City: <input readonly="readonly" type="text" name="2c" size="11" maxlength="80" value="Terre Haute" /></label>
<label>State: <input readonly="readonly" type="text" name="2s" maxlength="2" size="1" value="IN" /></label>
<label>Zip: <input readonly="readonly" type="text" name="2z" size="6" maxlength="10" value="47807">
</fieldset>

<input type="submit" value="Get Directions from Map Quest" />

<form>

jeffda
06-26-2003, 10:50 AM
Thanks all for the help. Dave, your example is purdy close to what I wanted. I wanted everything that you had plus a textbox that the user could enter their address into then hit enter and a little mark would show them where they are on the map...and also have a little mark showing where the church is. Now I'm pretty sure that it can't be done that way, but if it can be done than I would like to use it. Vladdy...thankyou for your script, I think that I might use it for the website if that's ok with you. Thanks again.

Vladdy
06-26-2003, 11:39 AM
It's not a script, just an HTML form. Compared to scripting solution it considerably increases browser compatibility and is shorter than any scripting solution you may find, for the simple reason that it gathers the data and sends it to mapquest to do the work.
If you will use this approach, I would recommend contacting MapQuest and asking them if they have a problem with such arrangement. I can not think of a reason why they would - you are a non-profit organization and you are sending the traffic their way - but it is always nice to have things like that covered.