I am having a problem with an export of a map with a Google Maps background and a single overlay.
The map control has a Google Overlay and a Google Layer. I use the Google Overlay to allow the user to interactively explore the map. When they click the export button I switch the active overlay to the Google Layer and do the export. This will include the Google Maps background since a Google Overlay is client-side and will not be included.
When the user is seeing the interactive map, the screen shot looks like this:
...but when the click the export button the resulting bitmap looks like this:
As you can see, the overlay is askew in relation to the Google Maps background. Can anyone tell me why that might be?
Here is the code that produces the bitmap export:
ctlMap.CustomOverlays(GOOGLELAYERNAME).IsVisible = True
ctlMap.ActiveBaseOverlay = ctlMap.CustomOverlays(GOOGLELAYERNAME)
Dim bmp As System.Drawing.Bitmap = ctlMap.GetBitmap(ctlMap.Width.Value, ctlMap.Height.Value)
ctlMap.ActiveBaseOverlay = ctlMap.CustomOverlays(GOOGLEOVERLAYNAME)
ctlMap.CustomOverlays(GOOGLELAYERNAME).IsVisible = False
Dim jpgEncoder As ImageCodecInfo = GetEncoder(ImageFormat.Jpeg)
Dim qualityEncoder As System.Drawing.Imaging.Encoder = System.Drawing.Imaging.Encoder.Quality
Dim jpgEncoderParms As New System.Drawing.Imaging.EncoderParameters(1)
Dim jpgQualityParm As New System.Drawing.Imaging.EncoderParameter(qualityEncoder, 90)
jpgEncoderParms.Param(0) = jpgQualityParm
bmp.Save(Server.MapPath(tempFileName), jpgEncoder, jpgEncoderParms)
Any assistance is greatly appreciated.
Bob Mc.