Jorge.Soares


I my problem it's when i call GetRoute from api, it only appears with the turn point's (that numered red points on turns). The (blue) road directions don't appear. It's strange and i don't know why!

Can anyone help me with this

My code it's the next:

function GoToDirections(LatPt1,LongPt1,LatPt2,LongPt2)

{

var PontosTrace= new Array;

PontosTrace.push(new VELatLong(parseFloat(LatPt1),parseFloat(LongPt1)));

PontosTrace.push(new VELatLong(parseFloat(LatPt2),parseFloat(LongPt2)));

map.GetRoute(PontosTrace[0], PontosTrace[1]);

}

ThanksWink



Re: GetRoute- No display road route

Derek Chan


Sorry I'm a bit confused, do you mean the blue polyline for the route isn't appearing but the red numbered pushpins are If so, can you post a sample code that duplicates this issue your seeing





Re: GetRoute- No display road route

jkuhlz

I have experienced this same issue, only instead of not seeing the blue line route, I don't see the red number images where the turns are. Sometimes it works, and other times it doesn't. I never experience any javascript errors though.




Re: GetRoute- No display road route

Jorge.Soares

This is my problem:http://bp1.blogger.com/_oqVmeXHYAeU/RlVS4d4hYNI/AAAAAAAAAAU/Z4TDRLlRMdo/s320/Untitled5.jpg

The Red turn points appears, but no BLUE LINE!Sad is not because the code, also i'v try with this code and the same thing happens..


var map = null;

function GetMap()
{
map = new VEMap('myMap');
map.LoadMap();
map.GetRoute("Space Needle", "Microsoft");
}






Re: GetRoute- No display road route

Duncan Garratt

I had the same problem a few months ago. When I changed my browser security settings the problem seemed to be solved. I can¡¯t remember exactly what setting I changed, but it fixed the problem.

Duncan Garratt

www.gis-logic.co.uk






Re: GetRoute- No display road route

Jorge.Soares

i put all my i.e. security settings in low security and nothing appens...

i'm using i.e 7.0 with Vista





Re: GetRoute- No display road route

Duncan Garratt

Try setting the browser to its defaults. The problem is with the browser settings and not the code.

Duncan Garratt




Re: GetRoute- No display road route

Jorge.Soares

Problem continues..

I've changed all i.e. settings and nothing!Sad





Re: GetRoute- No display road route

SoulSolutions

Can you confirm that it doesn't work on http://maps.live.com for you

Add two pushpins (right mouse context menu)

Draw a route between them.

If it doesn't work here then their is something wrong with the way VE work for you.

If it does work maybe there is something missing or conflicting in your code.

John.






Re: GetRoute- No display road route

Jorge.Soares

On http://maps.live.com works fine..

i don't understand why only doesn't work with api..





Re: GetRoute- No display road route

JoeBloggs

Are you using a javascript popup window to display your map I found that if I use an ordinary window the route map works fine but when I use a javascript popup window the blue polyline doesn't display.



Re: GetRoute- No display road route

Jorge.Soares

Sorry, I don't understand what do you mean with "ordinary window",

I have a html page with div to display the map.

there is the code:

HTML:

</script>

<style type="text/css">

html, body

{

overflow: hidden;

}

</style>

</head>

<body bottommargin="0" leftmargin="0" rightmargin="0" topmargin="0" >

<div id="mapContainer"></div>

</body>

</html>

And for Map i use this javascript function:

map = new VEMap("mapContainer");

map.LoadMap();

map.Resize(document.documentElement.offsetWidth, document.documentElement.offsetHeight);

map.SetCenter(new VELatLong(41.5370749368487,-8.43541802469737));

map.SetZoomLevel(7);

I create map in Div section.





Re: GetRoute- No display road route

Jorge.Soares

Problem Solved!

It because HTML Header i had:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html> <head>

and change for this one:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Thank you allSmile