Mombu the Microsoft Forum

Go Back   Mombu the Microsoft Forum > Microsoft > MICROSOFT CRM (TECHNET) > Google Map in CRM IFRAME
User Name
Password
REGISTER NOW! Mark Forums Read




Reply
 
1 11th April 06:06
curtis johnstone
External User
 
Posts: 1
Default Google Map in CRM IFRAME



Has anyone been successful in hosting a Google Map in a CRM Form IFRAME?

For example, I added a Map tab with an IFRAME and in the form OnLoad() event
I tried setting adding Javascript to set the IFRAME.src to
"http://maps.google.ca/maps?q=street address, city, state";

The Google Map just gets stuck and displays a "Loading..." sign where the
map image should be. I think the Google Maps javascript doesn't work inside
the CRM IFRAME.

I've tried several other things such as replacing the IFRAME HTML with
embedded Javascript - no luck. I don't really want to resort to the Google
Maps API. Any suggestions?
  Reply With Quote


 


2 11th April 20:37
michael höhne
External User
 
Posts: 1
Default Google Map in CRM IFRAME



It does work when you uncheck the restrict cross-frame scripting in your
iframe. At least the map is displayed on my machine after that change.

--
Michael

Web: http://www.stunnware.com/crm2
Feed: http://www.stunnware.com/crm2/atom.aspx

----------------------------------------------------------

"Curtis Johnstone" <CurtisJohnstone@discussions.microsoft.com> schrieb im
Newsbeitrag news:BB808C22-290B-4A46-9D8C-1BE18C698D3E@microsoft.com...
  Reply With Quote
3 12th April 11:56
curtis johnstone
External User
 
Posts: 1
Default Google Map in CRM IFRAME


I had the cross-frame scripting unchecked. I tried changing the format of the
Google Maps URL and I had a bit more success. I also moved the setting of the
IFRAME src to the Map tab OnClick() event, and it works except the Google
Maps address marker is not displayed and there is one Javascript error ("x"
is null or not an object).

What event did you hook it to - the form load or when the tab is clicked?
Also, what Google Maps URL format are you using?

In terms of formatting, I have the IFRAME set to 10 rows, expand to use
available space and scroll as necessary, but the map is still really small.

Thanks,
Curtis
  Reply With Quote
4 12th April 11:56
michael höhne
External User
 
Posts: 1
Default Google Map in CRM IFRAME


I used
http://maps.google.ca/maps?q=Saint+Helens,+Merseyside,+WA10,+UK&ie=UTF8&hl=de&z=14&ll=53.456167,-2.736883&spn=0.021874,0.095873&om=1&iwloc=A
and for a quick test put that into the iframe source in the form designer.
The iframe is set to 4 lines (default) and to expand to fill the remaining
area. I also noticed the same behavior you described (map was not resized,
no address marker), but it only occurred the first time I opened a form.
After that everything worked well. I get the same script error though. Maybe
the problems occurs every time a new map is loaded and as I didn't use code
to dynamically load it, some caching may have prevented these issues to show
up again.

--
Michael

Web: http://www.stunnware.com/crm2
Feed: http://www.stunnware.com/crm2/atom.aspx

----------------------------------------------------------

"Curtis Johnstone" <CurtisJohnstone@discussions.microsoft.com> schrieb im
Newsbeitrag news:6A4BE9F7-A5B1-48A5-A4ED-30D6EA0F192E@microsoft.com...
  Reply With Quote
5 12th April 16:49
curtis johnstone
External User
 
Posts: 1
Default Google Map in CRM IFRAME


I still get the Javascript error on repeated form opens. I set the IFRAME to
Always Scroll and that helped the formatting. If I could just get the map
marker to display it would be good enough. I may have to resport to a more
involved solution.

Curtis
  Reply With Quote
6 21st August 17:42
External User
 
Posts: 1
Default Googlemaps


I never did it in an Iframe (which should be easier than sending it to a new window) but I made an aspx page (C#) with an extra datareader that reads the data from the database based on the guid of the account. The datareader I got from a local supplier but you should be able to write or buy one easily.

the aspx spawns a new window with the googlemaps page.

<body>
<%
string Country = "&nbsp;";
string City = "&nbsp;";
string map_url = "&nbsp;";
//datareader for City and Country

map_url ="http://maps.google.com/maps?oi=map&q=" + City + "+" + Country;
System.Web.HttpContext.Current.Response.Redirect(m ap_url);
}
%>
</body>

If you want to do it in an IFrame on the form in CRM it would look a bit like this in the onload script

var iFrame = crmForm.all.IFRAME_Map;
iFrame.url= "http://maps.google.com/maps?oi=map&q=" + crmForm.all.address1_city.value + "+" + crmForm.all.address1_country;

where IFRAME_Map the name is of the IFrame


PS: Also check your security settings on the server.

Greetz
Beegee

EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
  Reply With Quote
7 21st August 17:42
crmnewbier¹{āyų¬rė,Љģš+¢źµź&
External User
 
Posts: 1
Default Google Map in CRM IFRAME


I modified the isv.config.xml file and created a "Map" button under the
"Account Toolbar" so a new window will open.

I attempted to do an IFrame but was having similar issues. However, I was
successful in displaying Mapquest and a Yahoo Maps in an IFrame but ran into
numerous JavaScript errors when trying to print from the IFrame.

This code uses only the Address1 and Zip fields and a hard coded starting
point.

Following is the code for the "Map" button:

<Button Title="Map" ToolTip="Info on Test" Icon="/_imgs/ico_18_debug.gif"
JavaScript="
var startAddr, startZip, endAddr, endZip, url;

//Hard Coded starting point - Change the startAddr and startZip
startAddr = '1600+Pennsylvania+Avenue+NW';
startZip = '20500';

//Replace a space with a + sign for the url
endAddr = crmForm.all.address1_line1.value;
endAddr = endAddr.replace(' ', '+');

endZip = crmForm.all.address1_postalcode.value;

url = 'http://maps.google.com/maps?f=d&hl=en&saddr=' + startAddr + '+' +
startZip + '&daddr=' + endAddr + '+' + endZip
window.open(url);" AvailableOffline="false"/>

Hope this helps!
As always try this in a testing environment first!
  Reply With Quote
8 23rd August 07:59
curtis johnstone
External User
 
Posts: 1
Default Googlemaps


I tried everything to get it to work directly in an iframe and there was
always some quirky issue.

I got it to work great in a custom aspx application and I am using the
Google API. Your solution should work also.

Thanks,
Curtis
  Reply With Quote


 


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666