Key not present in the dictionary
I am getting an error for the HTML5 Viewer using the workflow found in the link below:
https://support.geocortex.com/essentialsGSCkba?sub-nav=kba&main-nav=essentials&#!/feedtype=SINGLE_ARTICLE_DETAIL&criteria=BESTANSWERS&id=kA360000000CibyCAC
The same workflow works just fine for the Silverlight viewer.
The error that I get is: Unhandled exception: 'The given key was not present in the dictionary.' in activity '1.xxx: Assign'. The given key was not present in the dictionary.
When I look at the line of code where the error is occuring in the workflow (the assign activity) it is:
CType(eventArgs.GetValue("NewExtent.xmin"),Double) ...BTW, this is assigned to the "newXmin" variable.
I believe that the key refers to the NewExtent key of the key/value pair...am I correct?
The event being listened to is the MapExtentChangedEvent and it's EventArgs are assigned to the eventArgs variable. This leads me to believe that the "NewExtent" is NOT part of the GetValues method/property. Am I onto something?
Any help is appreciated...
Michael
0
-
Hi Michael,
That article is specific to Silverlight. Because the APIs return different fields, the same workflow is not compatible with the HTML5 viewer. In the alert that pops up with !! as the title you will see the field NewExtent is not included and the workflow depends on it.
Regards,
Wayne0 -
Wayne,
Thanks for that. Yes, I understand that this workflow was written for the Silverlight viewer. I want to adapt it for the HTML5 viewer. I have made the determination that the only place where this workflow "breaks" is with the "NewExtent" method (property?) for the eventArgs variable.
So...I am just wondering what methods/properties are returned by the MapExtentChangedEvent. Wouldn't a "NewExtent" method/property be returned when a MapExtentChangedEvent fires in the HTML5 viewer? (Maybe it has another name, but I assume that there is something analgous in the HTML5 event).
Any help is appreciated!
Michael0 -
Michael, did you have any success in this? I'm faced with the same problem. 0 -
No, I did not get any satisfactory help on this (as you can see from above) and I didn't pursue it any further because we implemented a Silverlight viewer--so the HTML side of things was not needed. I am still curious about this and really think I was onto something. It just seems to me that the support tech didn't dig deep enough, but maybe I am wrong on that. We don't have a very substantial support contract with Latitude, so I decided not to pursue it any further.
But, if you find anything, can you make sure to post it back to this chain of comments?
Thanks!
Michael0 -
Maybe it's a bit late, but if you're still interested, how I got it working is, first I use eventArgs.Json to understand the structure of JSON denotes. Once I know what denotes keywords are, then I could use .GetValue to get what I need. For example, for the MapMouseDownEvent, the .JSON will return {"0":{"isTrusted":true,"screenPoint":{"type":"point","x":394,"y":281.625},"mapPoint":{"type":"point","x":17043548.60147515,"y":-3169731.243495448,"spatialReference":{"wkid":102100}},"numPoints":0}}So to get the x coordinator of the map, I use eventArgs.GetValue("0.mapPoint.x"). Note the denote keywords are case sensitive!0
Please sign in to leave a comment.
Comments
5 comments