OpenStreetMap is a powerfull worldwide map created by volunteers. You can read more here: http://wiki.openstreetmap.org/wiki/Main_Page
To implement OpenStreetMap on Dynamics CRM 2011 we use the following services:
- GeoNames (to lookup post codes) - http://www.geonames.org/
- OpenLayers (free javascript map library) - http://www.openlayers.org/
- OpenStreetMap layers
- Jquery
Step 1 - Create a HTML webresource
Navigate to Settings > Customizations > Customize the system > click on web resources and click new.
Click Text Editor > click tab source > < paste the below code:
When you save it, you can ignore the error messages $. is undefined. Save and Publish.
Step 2 - Customize your entity
using the account entity start by creating a new section called map:1. Customize the main Account form, click the insert tab and select One column Section.
2. Confirm is set to one column and click OK
3. High light the section on the form and go to insert > Webresource and add the osmap_loader
Click ok, Save and Publish.
Result
Open an account make sure the postal code is not empty:
You can navigate around, and zoom in and out.
Summary
Hope you enjoyed this tutorial, is pretty straight forward and completely free of charges.
GeoNames
The solution above uses the Postal code lookup API from GeoNames however GeoNames have more API's that can search for addresse's cities etc, lookup GeoNames services here:
- http://www.geonames.org/
Performance
Note that I'm loading the jquery library and openlayers library on the form, if you have a heavily customized form, this can add some extra load time, my advise would be to collapse the tab and allow users to expand the map as they needed, this way the map will only be loaded when you expand the tab.