Google Street View in a report
Ok, I'm sure almost everyone has tried this yet I'm finding little documentation on how to pull this off. I have a simple report I want to add Google Street view to. Ideally, without using a workflow. I found the Parcel.rpx that has some addded script to it but I can't seem to make it work. I was able to add a feature map so feel like I'm so close. If anyone can help me it might just salvage my holidays. The script I'm using is below. The two field names are from the layer that I added the report to. They include the address and city. Has the Google API URL changed. Thanks!!!
public void detail_Format()
{
try {
string imageUrl = String.Format("http://maps.googleapis.com/maps/api/streetview?size=400x400&location={0} {1}&sensor=false"
, rpt.Fields["SITEADDR"].Value.ToString()
, rpt.Fields["SITECITY"].Value.ToString() );
System.Net.WebClient client = new System.Net.WebClient();
System.IO.Stream stream = client.OpenRead(imageUrl);
System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(stream);
stream.Flush();
stream.Close();
Picture streetView = (Picture)rpt.Sections["Detail1"].Controls["StreetView"];
streetView.Image = (Image)bitmap;
} catch {}
}
0
-
Figured it out! 0 -
I would like to integrate this into reports. What ended up being the issue for you? 0 -
Hi Aaron,
If I remember correctly there were a few things. The basic script above is what you want to use. I think I had the line..
Picture streetView = (Picture)rpt.Sections["Detail1"].Controls["StreetView"]; wrong. In my report, I didn't have a "Detail1" but instead "Detail". The more I think about it there was some code I even had to add within the workflow so the report knew which address it was even looking for. I used the code and workflow in the LA County site to guide me and used another link on the support page that I can't seem to find for the life of me. Good luck and if you need me to send my code just let me know.0 -
Jeff,
Thank you for the reply. If you are up for sending me the code, I would love that. My address is anepple@firstam.com.
Thanks,
Aaron Nepple0 -
Aaron,
I just sent the code to your email. Let me know if you don't get it. I sent it as a zip file and I know some IT departments block those. Cheers!0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
5 Kommentare