the getBitmap function is throwing an error:
The parameter you supplied may not be null.
Parameter name: worldExtent
Thanks,
Eric
the getBitmap function is throwing an error:
The parameter you supplied may not be null.
Parameter name: worldExtent
Thanks,
Eric
I have determined that Map1.CurrentExtent null at the point I attempt to execute the getBitmap function. Why it is null I do not know.
If I manually assign map1.currentextent the getgetbitmap function works. However, since the assinged extent is different from what is actually on screen, the produced image is different.
How can i set the extent to actually reflect what is on screen??
Hello Eric,
Thanks for your post, could you please provide a sample that can recreate this problem?
I appreciate for your help, that will let us find the root cause faster.
Regards,
Gary
The following code is within a callback. before this i have changed the extent via a call back on both the server and client side.
if I omit the line where i assign map1.current extent a value the value is null. I need to be able to retrieve the extent of what is currently on the screen so.
case "All":
Map1.CustomOverlays.Clear();
Map1.StaticOverlay.Layers.Clear();
Map1.StaticOverlay.Layers.Add(OverlayClass.DefineBaseMap(statepath));
GeoCollection<Overlay> MapOverlays = OverlayClass.GetOverlays(sessionidvar, Argument, statepath);
foreach (Overlay mapLOLs in MapOverlays)
{
Map1.CustomOverlays.Add(mapLOLs);
}
Map1.CurrentExtent = OverlayClass.GetExtent(sessionidvar);
CBResult = "All," + Map1.CurrentExtent.ToString();
break;
Eric,
The code that you provided lacks greater context and it is difficult to recreate your problem. Could you try to isolate the problem by creating a little self contained sample app that we can run? I appreciate your effort on that one. On my side, I am still going to ask the Web team to see if they spot something obviouslyy wrong with your code that could cause the behavior that you described. Thank you very much.
Hi Eric,
I have several questions shown as below:
1. Did you do all things in page_Load method? Like invoke GetBitmap method.
2. Are you using real value in pixel for map’s width/height, or %?
To export map using GetBitmap method, map’s real width/height in pixel and currentExtent is required. If we are using the “*%” as the width/height, the right value in pixel just be calculated after a Postback, because we have to calculate the real width/height on client side.
Just from your description, I guess you are using “*%” as the width/height, and initialize the map in a callback, if in that case, the map is unable to get the real width and height, and then it will throw the exception. Please try the width/height in pixel, or could you create a demo for us or post more details here?
Best Regards,
-Johnny
I will send more info, I was able to work around the problem. This is not being done in the page_load method, but it is being done as a callback event. The problem seems to be related to the fact that map1.current extent is null unless I manually assign it. I have worked around the problem by getting the current extent on the client side, and passing the client side extent back as callback arguments. I then assign the client side extent to map1.current extent.
I will get you more info later, my fix works for now, and I have a deadline to meet. I would like to revisit this in the future though.
Thank you,
Eric
Hello Eric,
What do you do in your page_load event? Because MS server side will execute after page_load event, so if you try to get some map data in this event, it will be null.
You can try OnMapCreated event instead of page_load.
Regards,
Gary