Something that has always interested me was mapping data from the CRM system onto GoogleMaps. I just found this so useful to me so I could better understand where my information came from. Wouldn't it be nice to see that you always generate your business in certain areas? To that point, wouldn't it also be nice to see what areas you should start marketing in to increase your business? Mapping your data can help you do this! Now the rest of this article is going to talk about how this works from within SLX. My code is always welcome to our partners and will be posted here http://sites.google.com/site/genesprojects/ by the end of the week (just need to clean a few things up hahaha).
Here is a link to a picture of the "My Accounts" group mapped within SLX. As you can see on this picture you can activate a group then the records in that group will be mapped on a GoogleMap. Lets talk about what is actually happening here step by step....
1. First thing that you don't see here is that I GeoCoded the entire address and lead_address tables. What that means is I took the addresses from within those tables and found out what the latitude and longitude of each of them are. You really need to do this if you want the mapping process to move along at a timely pace. If you don't GeoCode your system then you have to pass an address to Google which then has to GeoCode it and pass you back the lat/lon which you then pass back to Google for mapping. This takes to much time and is not the way you want to handle things. Currently I have built a C# GeoCoding application that will GeoCode both the address and lead_address tables. You can find this app (also later this week) on my site as well.
2. Now with the addresses all GeoCoded you can have some fun! So lets continue along here with our process. The next step would be to find out some information about the current status of your session. What I mean here is, what are you looking at? We need to know if your looking at Accounts, Contacts or what ever. We also need to know what group is in context as well so we can grab all it's items. The code within my project does exactly that, it checks to see what group is active. That information also reports back the current entity as well which we need. I'll explain why next
3. Knowing the group and entity information is key here. The next step is we take the group id reported back and we look that group up from within SLX. When this is returned we can find out all the record ids in that group! This is great because we also know what entity we are looking at so we know that all the ids that have been returned are for the entity that has been reported back to use, perfect.
4. Almost done now! With the entity ids in hand the next step is pretty easy. We just cycle through each one and pull back the address that is attached to that entity. Now that last sentence I just type actually contains a few steps, but this is all documented in the code. The short version is I created some namedqueries that are called to give you back the information about each record you are looking at. It's all pretty straightforward and will be easy enough to understand.
5. Last part my friends. With the address information obtained we can plot this marker on our map! Google really makes this pretty easy to do. Most of the code I'm using is right from their examples. The only fancy thing I added was a clustering tool. You can plot up to 1000 records with my code (I just have it cap at 1000, you can do what you want). Now if you do a lot of work in one area of the map this is going to look very messy. The clustering tool groups markers together that are close on the map so it is much more user friendly.
Wow, a lot of information here huh? Well the best part is that I have this all working for you so you can install it and play around on your own to learn more. The code will be posted later this week and all you will need to do in advance is get your own Google Map Key. This key is bound to the URL you are calling the map api from. What that means is if your system is at http://localhost:3333/SLXClient then you need to register http://localhost:3333.
I'm sure some questions will come up so make sure you post them in the community so I can answer them and share with others