Click to See Complete Forum and Search --> : Mapquest or Yahoo maps on website
cstickman
05-14-2004, 11:50 PM
I have a website now that I maintain that I want to be able to add a mapquest or yahoo to it. What I am trying to do is when they click on get directions to the store I want the store address to already be entered into the screen so all they have to do is add there address to it and then click on get directions. Any way this is possible or no? I see it on some websites now, but have no clue on how they are doing it. I know with mapquest you can buy there software and can do it, but the software is like 3000.00 or higher for it plus I do not want to run the server for it. Any help would be great. Thanks!!
Khalid Ali
05-15-2004, 12:52 AM
personally I don't think a free software for map display is available(I could be wrong)
And its deffinitley not available in JavaScript(beyond javascripts scope)
IceMetalPunk
05-15-2004, 09:03 PM
You can modify MapQuest's URL. Try this script:
<form action="JavaScript:Directions()" name="j"><h3>Address: <input name="add"><BR>City: <input name="city"><br>State Abbreviation: <input name="state" size=1 maxlength=2><BR>Zip Code: <input name="zip" size=4><P><script>
function Directions() {
//Program YOUR address, city, state, and zip below.
myaddress="11085 NW 38th Place";
mycity="Sunrise";
mystate="FL";
myzip="33351";
//Do NOT Edit below here.
address=document.j.add.value.split(" ").join("+");
city=document.j.city.value.split(" ").join("+");
state=document.j.state.value.split(" ").join("+");
zip=document.j.zip.value.split(" ").join("+");
myaddress=myaddress.split(" ").join("+");
mycity=mycity.split(" ").join("+");
mystate=mystate.split(" ").join("+");
myzip=myzip.split(" ").join("+");
window.location.href="http://www.mapquest.com/directions/main.adp?go=1&do=nw&un=m&2tabval=address&cl=EN&ct=NA&1tabval=address&bs.x=0&bs.y=0&bs=bs&1y=US&1a="+address+"&1c="+city+"&1s="+state+"&1z="+zip+"&2y=US&2a="+myaddress+"&2c="+mycity+"&2s="+mystate+"&2z="+myzip+"&idx=0&id=40a6c70c-003dc-0034b-cdbcf363&aid=40a6c70c-003dd-0034b-cdbcf363";
}
</script><input type="submit" value="Get Directions">
That works here...
-IceMetalPunk ;)
cstickman
08-11-2006, 10:33 AM
Okay the above script by icemetalpunk works great, but how do you get it to open in a new window? I tried putting in newWindow.location.etc , but I get an error everytime. Any suggestions? Thanks