CRM 2011 - Google map integration
-
Monday, November 14, 2011 12:30 AM
Hi Forum,
I have a requirement to integrate google maps with CRM 2011 on premise deployment.
Below is a setup.
1. Account entity has 1 section with 5 address fields (street, city,postcode,state,country)
2. Just below these fields, I have a another section which will have a iframe showing google map based on the above address.
I have achived this by using iframe url and passing parameters of the address fields to it with below line
var Iframe_map.src = "http://maps.google.com/?q=" + url + "&output=embed&t=m"; (url = street + City + state + postcode + country).
This is working perfectly fine.
But I want to do the same by using Google map API and not the above way. ( to get better control on the map)
I have seen the code at below google API site.
http://code.google.com/apis/maps/documentation/javascript/tutorial.html
but I am not sure how to pass
1. The address fields of the form to the iframe url
2. How to get reference of the map API. ( So I can use 'map' object to access methods and properties defined in API)
I have seen few blog entries but set up of their map is not same as mine. (Someof them are showing map using html/.aspx page and some with Silverlight control)
any ideas ?
Thanks for your time.
H.Desai
All Replies
-
Monday, November 14, 2011 2:25 AMModerator
I would do it in silverlight and upload it as a web resource. You can see in the examples on the linked page how you can programmatically get at the Xrm.Page properties that way so you can effectively grab your attributes right from the from fields.
http://msdn.microsoft.com/en-us/library/gg309342.aspx
Jamie Miley
Check out my about.me profile!
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter! -
Tuesday, November 15, 2011 3:19 AM
Hi Jamie,
Thanks for your reply. I will have a look at what you have suggested.
So that means, it's not possible to do it the way i have described.
Regards,
H.desai
-
Tuesday, November 15, 2011 1:50 PMModerator
I was just providing an alternate suggestion, you can pass URL parameters pretty easily by setting the iframe URL as done in this link.
http://danielbergsten.wordpress.com/2011/02/09/crm-2011-javascript-to-set-iframe-url/
Jamie Miley
Check out my about.me profile!
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!- Marked As Answer by DavidJennawayMVP, Moderator Friday, December 02, 2011 5:59 PM
-
Monday, April 30, 2012 6:16 PM
Desai,
Did you ever get this to work? I would like to do the same thing and I've am able to get the iFrame to show the Google map but then the whole page just freezes on me and I have to close I.E. Other web pages show up and work fine in the iFrame but not http://maps.google.com?output=embed. Any thoughts? Thank you.
-
Saturday, August 18, 2012 11:54 AM
Found this solution on codeplex that helped a bunch. I used his approach and was able to create my own html/script page to display in the iFrame and now it works. The webpage grabs the Lat and Long coordinates in my form to locate the position of the pin. If the Lat and Lon are unknown, it then uses the address fields and geo-coding to locate the address. I was even able to make the pin dragable so that when moved it updates the Lat and Long coordinates on my CRM form for when the Geo-coding isn't quite on target.

