Google/Bing maps implementation
Integrating any mapping technology into CRM provides you with quick access to where you want to go. By following these steps, you'll be able to add Bing maps and/or Google maps to your system in no time. This works with Online as well as On Premise.
What are the benifits from this? Simple.
1) There's no need for a hosted page (.aspx or .htm)
2) You get current, real time address values from the Account (or Contact) page. In other words it will just pull from your entered data and the page and it checks it dynamically without having to hit save (the maps query the fields when they are selected on the tabs).
As you can see, this example uses the Account page, but you can apply this to any entity.
Here are the steps:
Note: Only type what is in between the quotation marks (except in the code)
Step 1: Go to Settings >> Customization >> Account >> Forms and Views >> Form.
Step 2: Click “Add a Tab” and type in a name. (In our case we are using “Map It!”)
FIGURE A
Step 3: You should see your new tab appear on the screen. Next, click “Add a Section” and type in a name. (In our case we are using “bMap”) Click OK.
Step 4: Click your bMap section and click “Add an IFRAME” and type in a name. (In our case we are using “bingMap”)
In the URL field type “about:blank” Note: be sure to uncheck “Restrict Cross Framing” (see FIGURE B); in the Formatting tab, check “Auto expand to use available space” (see FIGURE C).
FIGURE B
FIGURE C
Step 5: Next, hit OK and click “Form Properties”. Then, click “OnLoad” and press “Edit”.
Step 6: Note: make sure “Event is enabled” is checked.
Then insert the following into the white space (you do type in the quotation marks within this code--See FIGURE D):
crmForm.all.tab4Tab.attachEvent("onclick", doMap);function doMap()
{
if (crmForm.all.address1_line1.value != null)
{
crmForm.all.IFRAME_bingMap.src = ("http://www.bing.com/maps/default.aspx?where1=" + crmForm.all.address1_line1.value + ", " + crmForm.all.address1_city.value +", " + crmForm.all.address1_stateorprovince.value);}
else{
crmForm.all.IFRAME_bingMap.src = "about:blank";
}
}
FIGURE D
Note: You may need to change “tab4Tab” to wherever your respective tab is.
The tabs are numbered from left to right starting at zero. For instance, if you wanted to use the very first tab on the left, you would use “tab0Tab”.
Also: Replace “bingMap” with the name of your IFRAME. Finally, click OK >> OK >> Save To see your new map in action press Preview >> Create Form
FIGURE E
If you haven’t noticed, the address is being pulled from the General Tab (Street 1, City, and State/Province)
If you want to integrate Google Maps, simply do the following: In the OnLoad code, replace “http://www.bing.com/maps/default.aspx?where1=” with "http://www.maps.google.com/maps?q="
(you may also want to change the name of your IFRAME to googleMap)
FIGURE F