Menu
 
Questions? Call Toll-Free 866-847-7510

Discussion Forums

Map Suite Support and User Discussion

(URGENT !) - Javascript Error on EditShape Mode
Last Post 02-01-2009 02:53 AM by Ben. 8 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Pierre-AntoineUser is Offline Level 4 Level 4 Posts:97 Avatar
--
01-12-2009 08:14 AM

Hello everyone,

 

I have this error when I'm using the EditShape Mode : "the given key was not present in the dictionary".

 

When I edit a polygon and i want to finish the new shape, I click into the shape, the component goes correctly in the TrackShapeFinished method. But if I click outside the polygon, this error appears. After that error, I can't edit an other shape or change the map mode.

 

Have you ever encountered this kind of problem?

 

Thanks in advance.



Pierre-Antoine DOUCHET IT Developer / www.geosys.com
Pierre-AntoineUser is Offline Level 4 Level 4 Posts:97 Avatar
--
01-12-2009 09:25 AM

I just discover that when I click outside the shape or when I want to change the map mode, the component enter into the Page_Load and into the if(!IsPostBack){ ... ... }.

 

I don't understand why the component goes into that ?

Is it not a Post Back when I want to change the mode or when I click outside the shape ?

 

I use the component in an other page of the web site and this problem doesn't appear and it's the same way to edit or to change the mode !

 

Edit : This is the javascript function that cause the error ("this._clearTimer();") :

 

function Sys$Net$XMLHttpExecutor$abort() { ///

if (arguments.length !== 0) throw Error.parameterCount(); if (!this._started) { throw Error.invalidOperation(Sys.Res.cannotAbortBeforeStart); } if (this._aborted || this._responseAvailable || this._timedOut) return; this._aborted = true; this._clearTimer(); if (this._xmlHttpRequest && !this._responseAvailable) { this._xmlHttpRequest.onreadystatechange = Function.emptyMethod; this._xmlHttpRequest.abort(); this._xmlHttpRequest = null; this._webRequest.completed(Sys.EventArgs.Empty); } }

 

I don't know if this code is created by Map Suite or by .NET.



Pierre-Antoine DOUCHET IT Developer / www.geosys.com
BenUser is Offline MVP MVP Posts:1764 Avatar
--
01-12-2009 10:01 PM

Pierre,

I couldn't recreate this problem. Could you provide more description about this, it will be great if you can send me a small sample so we can debug here. As now I have no idea why it enter the (!PostBack) block and we never encounter that.
 
The JavaScript block is created by Asp.net Ajax Framework, see the following link for more detail.
http://xeddiex.com/ClientReference/Sys.Net/XmlHttpExecutorClass/XmlHttpExecutorAbortMethod.aspx
Thanks,
 
Ben

 



Need to know how to do something with Map Suite? Check our Wiki Code Samples Library and view the source code of any sample right in your web browser.

Pierre-AntoineUser is Offline Level 4 Level 4 Posts:97 Avatar
--
01-13-2009 03:05 AM

Here's my files.

 

I'll search on my side too. If it's a framework problem, I can find how debug that error.

 

I saw that FireFox and IE don't give the same error :

FireFox :
Erreur : [Exception... "'Sys.ParameterCountException: Sys.ParameterCountException: Parameter count mismatch.' when calling method: [nsIDOMEventListener::handleEvent]"  nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)"  location: "JS frame :: http://localhost:39270/ScriptResource.axd?d=BjTbBXg2XH_V1XmJZ7yHuwSXPH-5-fDb3Wg5BXc85TCeSrlvV3UUmrU56yYz9IJKvRe5X8yQfCLMoTgHz2ltIsrkELiXabHKVo8Dc-yYZSg1&t=531cc032 :: Sys$Net$XMLHttpExecutor$abort :: line 4920"  data: no]

 

function Sys$Net$XMLHttpExecutor$abort() { /// if (arguments.length !== 0) throw Error.parameterCount(); if (!this._started) { throw Error.invalidOperation(Sys.Res.cannotAbortBeforeStart); } if (this._aborted || this._responseAvailable || this._timedOut) return; this._aborted = true; this._clearTimer(); if (this._xmlHttpRequest&&!this._responseAvailable) { this._xmlHttpRequest.onreadystatechange = Function.emptyMethod; this._xmlHttpRequest.abort(); this._xmlHttpRequest = this._webRequest.completed(Sys.EventArgs.Empty); } }

IE :

Sys.WebForms.PageRequestManagerServerErrorException: The given key was not present in the dictionnary

 

this._onReadyStateChange = (function () { if (_this._xmlHttpRequest.readyState == 4 ) { try { if (typeof(_this._xmlHttpRequest.status) == "undefined") { return; } } catch(ex) { return; } _this._clearTimer(); _this._responseAvailable = true; try { _this._webRequest.completed(Sys.EventArgs.Empty); } finally { if (_this._xmlHttpRequest != null) { _this._xmlHttpRequest.onreadystatechange = Function.emptyMethod; _this._xmlHttpRequest = null; } } } });

ModuleCarto.zip

Pierre-Antoine DOUCHET IT Developer / www.geosys.com
BenUser is Offline MVP MVP Posts:1764 Avatar
--
01-13-2009 09:36 PM

Pierre,

Seems the update panel eats your internal exception and throw that JavaScript Exception. I think now to debug, you can remove your UpdatePanel temporarily so you can see the real exception directly.

I saw you get variables from session without checking if they are exists there, such as QnBbox, unit1, unit2, unit3, unit4, I only see you get them from session but didn’t find where you set it. Maybe that’s a problem.

If you still have problem, it will be great if you can send us a small standalone sample we can run here. As your last sample has many dependencies we can hardly make it run.

Thanks,

Ben
 



Need to know how to do something with Map Suite? Check our Wiki Code Samples Library and view the source code of any sample right in your web browser.

Pierre-AntoineUser is Offline Level 4 Level 4 Posts:97 Avatar
--
01-19-2009 03:00 AM

Hello,

 

I try to change everything in my page to detect the mistake but nothing happend. So, I try to change some Map Suite parameters.

I change the background layer. I replace the Google background layer by a WMS layer that I was using in another page. The error was gone.

I try to recreate the error but nothing happend with the WMS background layer.

I think that is a relation between my page and the component Google background layer. This is the Google overlay JavaScript Library Uri that we use : 

http://maps.google.com/maps?file=api&v=2&key=ABQIAAAALfuaURXlRpjuDdk9VCcixxTYJdkEban8I4k08n05mTv9qnwR8xQaLVb9-DX3BIiTb-MF9WT3ZqDqyg

I continue to do some tests on my side to see wich component could cause this error.

 

Thanks.



Pierre-Antoine DOUCHET IT Developer / www.geosys.com
BenUser is Offline MVP MVP Posts:1764 Avatar
--
01-20-2009 04:19 AM
Pierre,

We tried your google map key and it works. Could you copy that key to our sample to see if it works on your machine? if no I think maybe something wrong with you system and If yes can you send your sample codes to us so we can have a test here.

Thanks,

Ben



Need to know how to do something with Map Suite? Check our Wiki Code Samples Library and view the source code of any sample right in your web browser.

Pierre-AntoineUser is Offline Level 4 Level 4 Posts:97 Avatar
--
01-26-2009 09:07 AM

Hello,

I do some tests again and I think I found the problem.

The component is surrounded by an UpdatePanel. If I delete this UpdatePanel, the error is gone !

I create a page with only 3 buttons and the map surrounded by an UpdatePanel and the error happened again.

 

I join the page if you want to test it.

 

Thanks in advance.



Pierre-Antoine DOUCHET IT Developer / www.geosys.com
BenUser is Offline MVP MVP Posts:1764 Avatar
--
02-01-2009 02:53 AM
Pierre,

Please get the latest edition (3.1.0) and see if that issue still exists, it works fine here after some small modifications as following because of the API changes.

protected void Button1_Click(object sender, EventArgs e) { Map1.EditOverlay.TrackMode = TrackMode.None; } protected void Button2_Click(object sender, EventArgs e) { Map1.EditOverlay.TrackMode = TrackMode.Polygon; } protected void Button3_Click(object sender, EventArgs e) { Map1.EditOverlay.TrackMode = TrackMode.Edit; }

Thanks,

Ben


Need to know how to do something with Map Suite? Check our Wiki Code Samples Library and view the source code of any sample right in your web browser.

You are not authorized to post a reply.