Hi!
How can I export a google map (cum overlays) into an image file? I don't find a googlemaps method/function to do that ? Would there be a browser trick, a server-side or client-side scripting method?
Hi!
How can I export a google map (cum overlays) into an image file? I don't find a googlemaps method/function to do that ? Would there be a browser trick, a server-side or client-side scripting method?
Tin,
Thanks for your post, please refer the following code for your requirements:
If there are not any misunderstandings, I think the code above can meet your requirements exactly, the google layer can be export to your disk correctly, Any more questions please let us know again,
Map1.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.FromHtml("#E5E3DF"));
Map1.CurrentExtent = new RectangleShape(-13939426.6371, 6701997.4056, -7812401.86, 2626987.386962);
Map1.MapUnit = GeographyUnit.Meter;
GdiPlusGeoCanvas canvas = new GdiPlusGeoCanvas();
GoogleMapsLayer googleLayer = new GoogleMapsLayer();
googleLayer.Open();
Collection<SimpleCandidate> labelsInAllLayers = new Collection<SimpleCandidate>();
Bitmap bitmap = new Bitmap((int)Map1.Width.Value, (int)Map1.Height.Value);
canvas.BeginDrawing(bitmap, Map1.CurrentExtent, GeographyUnit.Meter);
googleLayer.Draw(canvas, labelsInAllLayers);
canvas.EndDrawing();
bitmap.Save(@"C:\Temp\Test.jpg");
googleLayer.Close();
Thanks,
Scott,
Scott,
Thanks you very much!
Tin,
That’s great!
Any more questions please let me know again,
Thanks,
Scott,