IWD2


Hi,

I'm having a complete nightmare with code that works most of the time and then stops for no apparent reason;

I'm using the v3 code;

dev.virtualearth.net/mapcontrol/v3/mapcontrol.js

and then I'm simply doing;

try {

objMap = new VEMap("idMap");

objMap.LoadMap(null, 10, "r", false);

objMap.HideDashboard();

objMap.SetScaleBarDistanceUnit(VEDistanceUnit.Kilometers);

objMap.FindLocation(varPostCode, fnOnFoundResults);

return

}

catch (e)

{

alert("Map Not Available : " + e + "(" + varPostCode + ")");

return

}

// end try

where varPostCode has been set to "TS12 9FB, UK"

But I then get the error;

"object error"

if I comment out the lines it occurrs on objMap.FindLocation(varPostCode, fnOnFoundResults)

fnOnFoundResults is;

function fnOnFoundResults(e)

{

try

{

var objPin = new VEPushpin(e[0].ID, e[0].LatLong);

objMap.AddPushpin(objPin);

}

catch(e)

{

alert(e);

}

// end try

}

Now why would code that worked happily one day just stop




Re: Code works one day and stops the next !

Coder_By_Day


I'm 'sort' of having the same problem, my 'get route' function was working fine one day, and now it doesn't seem to know UK post codes at all, very strange, maybe they have changed the code, or have changed the API

Can anyone throw some light on this






Re: Code works one day and stops the next !

CalvinKash

I'm having the same problem, my code stopped working...





Re: Code works one day and stops the next !

IWD2

I've actually now narrowed it down to some other javascript code on the page which works seamlessly with no errors on other pages on the site (it's a an ajax advert rotator thing with fadey in/out adverts that I've written). The only thing I can think of is that somewhere in that code there must be a reference to an object / variable or *something* that's now messing up *something* in the VE javascript.

Maybe using a different version of VE (5 ) will cure the problem due to something being re-written but it's a bit of a mare, especially as the site has now gone live.

cheers

Andy





Re: Code works one day and stops the next !

SoulSolutions

Interesting, if you could keep us update of what you find the conflict is that would be great.

I really should start a list somewhere, the only one I rememeber is that issue of not being able to have a div with an ID of "footer".

I'm sure there are a few more but really all the javascript should have the VE namespaces.

John.






Re: Code works one day and stops the next !

Coder_By_Day

Hi

Can you confirm the problem with UK postcodes

This seems to have happened the day after I put my project live, and it really depends on being able to find UK postcodes, it's now quite embarrising putting a site live after many months of development which worked fine until you release it live!

This is a major problem for me, I've tested other peoples sites who also use the route function and their sites respond in the same way, it's like all the UK post codes have been wiped out from the system, but typing place names is unaffected [ example: I can type London > Birmingham and it finds them, but try OX26 to E14, where it would normally find these post codes [ or any other UK post code or part post code ] it now only returns results for other countries ]

Please help!





Re: Code works one day and stops the next !

Coder_By_Day

Update :

I seem to have overcome the problem by adding an extra form field 'country' and appending it to each of the previous 2 form fields

it seems you now have to type the 'country' in to the route info box's otherwise it defaults to USA.

However this is still not ideal, as it is now messing up the rest of my code.

I'm also getting Javascript errors when before I didn't

Its saying 'Not enough Args'

Which makes me think MS have added a new Var 'country' but have not specified where we should put it.