Click here to Skip to main content
15,882,113 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Referring the code in https://www.aspforums.net/Threads/193958/Convert-Google-Maps-to-image-and-save-in-folder-using-JavaScript-in-Google-Maps-API-V3-in-ASPNet/[^]
C#
protected void Save(object sender, EventArgs e) {
    byte[] data;
    WebClient webClient = new WebClient();
    data = webClient.DownloadData(hfImageUrl.Value);
    File.WriteAllBytes(Server.MapPath("~/myGoogleMap.jpg"), data);
    imgServer.ImageUrl = "~/myGoogleMap.jpg";
    imgServer.AlternateText = "~/myGoogleMap.jpg";
}

I did save the myGoogleMap.jpg file. But this image is NOT viewable as an image. How can this be fixed? Thanks.

What I have tried:

How to Save a Google Map as an Image file?
Posted
Comments
MadMyche 17-Jan-19 11:57am    
What does come back and is saved? Have you asked the person that wrote that code? Are you using all of the posted code? What context are you going to use this image within?

1 solution

You should download Google Earth Pro, after looking for the place you want, press "File" in the top toolbar; "Save" and "Save Image ...".
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900