Register  |  Login

Question Details    

   Question

Time: 11:19 - Mar 11, 2007     Asked by: hknight      Status: Answered      Points: 250   

Help with Mapquest API: Geocodes ignored, Kansas used instead

Hello,

I am trying to get driving directions between two Canadian locations.

The problem is, no matter what I put for the Latitude / Longitude of the destination, it always maps to Kansas!

What is wrong and how can I fix this?

Thanks!

PS.... You will have to upload this to a server to test it because MapQuest requires that it be accessed via http://




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-t...
<html>
<head>
<script type="text/javascript"
src="http://web.openapi.mapquest.com/oapi/tra...
</script>
<title>
Mapquest Routing
</title>
<script type="text/javascript">
var mqRoute = null;
function doSubmit()
{
mqRoute = new MQRoute("container");
var thumbSize = new MQSize();
thumbSize.setHeight(150);
thumbSize.setWidth(300);
var overviewSize = new MQSize();
overviewSize.setHeight(400);
overviewSize.setWidth(600);
mqRoute.primaryMapSize = overviewSize;
var myRoute = new MQRoute("container");
var myLoc = new MQLocation();
myLoc.setLatitude('45.409097');
myLoc.setLongitude('-75.685449');
myRoute.origin = myLoc;
myLoc.setLatitude('45.4237332');
myLoc.setLongitude('-75.676332');
myRoute.dest = myLoc;
myRoute.doRoute();
}
function routeReturn(mqRoute, status) {
}
</script>
</head>
<body>
<div class="mqClear">
<form id="ddform" name="ddform" action="javascript:doSubmit();"
class="mqDefault" title="Get Directions">
<input type="hidden" name="go" value="1" />
<input type="hidden" name="do" value="nw" />
<input type="hidden" name="rmm" value="1" />
<input type="hidden" name="un" value="m" />
<input type="hidden" name="cl" value="EN" />
<input type="hidden" name="ct" value="NA" />
<input type="hidden" name="rsres" value="1" />
<input type="hidden" name="map" value="y" />
<div style="text-align:center">
<input type="submit" id="submit1"
value="Get Directions" tabindex="20"/></div>
</form>
</div>
<div>
<div id="container" class="mqContainer" style="width:600px;">
</div></div>
</body>
</html>



Ask a New Question

Become a Quomon Expert

Current Categories

 

Other Questions Needing Answers


   

Answer Discussion
Answer Discussion
Answer Summaries
Answer Summary
 
your code wont work for anyone cos the url is http://web.openapi.mapquest.com/oapi/tra... and I assume u need to have a key

Regarding setting destination, just a thought, try create another variable, does it make any difference?

eg
 var myLocDest = new MQLocation();
 myLocDest.setLatitude('45.4237332');
 myLocDest.setLongitude('-75.676332');
 myRoute.dest = myLocDest;

hopefully it will find Ottawa or something

Expert:

nidhi

Date:

Apr 12, 2007

Time:

07:00

 

Votes: Good (0) | Bad (0)
Login to rate this answer

Had a quick look in mapquest, it seems u need to set

myRoute.destination

and not myRoute.dest

I could be mistaken as I dont have that sdk
http://www.mapquest.com/features/main.ad...

Expert:

nidhi

Date:

Apr 12, 2007

Time:

07:03

 

Votes: Good (0) | Bad (0)
Login to rate this answer

hknight, please close this question and distribute the points.
If you didn't get a solution to your problem or you found it yourself, please leave a comment here to let the experts know.
Thanks,
Quomon Admin

Expert:

admin

Date:

Jun 16, 2007

Time:

16:09

 

Votes: Good (0) | Bad (0)
Login to rate this answer

The question has been closed.

Quomon Admin

Expert:

admin

Date:

Jun 25, 2007

Time:

06:09

 

Votes: Good (0) | Bad (0)
Login to rate this answer

Question Answered

This question has been answered, and points have been rewarded to the following experts:

nidhi: 250

You're welcome however to comment or give additional information or if you wish, you have the ability to write an Answer Summary for this question by clicking on the "Answer Summaries" Tab.

 
No summaries have been submitted yet. Want to be the first?



Respond to this question:

New User

  Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:


Forgotten Password

 

New User

  Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:


Forgotten Password

   

"Psst, Quomon is a great site. Pass it on."     Tell a Friend  |   Link To Us  |   Save to Delicious  |   Digg! Digg it


All Questions


Language Options

English:

www.quomon.com

Español:

www.quomon.es

Quomon Blog

blog.quomon.com

Sponsors

Questions and Answers Software
Real Estate Postcards
Marketing Fulfillment