Showing results for 
Search instead for 
Do you mean 

Adding some GoogleMaps to SLX

by on ‎02-01-2010 08:19 AM

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 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 Smiley Happy


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 Smiley Happy


My Accounts Mapped

by Gold Super Contributor
on ‎02-01-2010 10:34 AM
Thanks Gene!
by Silver Contributor
on ‎02-01-2010 12:50 PM

First thank you so much for the article!

One quick question - I always wondered about the "geocoding the database" step.  Isn't there a cap on the # of requests per hour for the free google map keys?  Or did you find that was not an issue?

on ‎02-01-2010 02:02 PM

You are correct about this limit. Here is a link to the limits Now this is for the free version so if you bought a contract things would be different.


I also built a version of the SLX GeoCoder that works with MapPoint. This is cool because you can run it till your blue in the face but has some major limits as well.


1. Only GeoCodes the US and CAN

2. You have to own it and have it installed on the server. (until I create a sData version hahaha)

3. You have to be more creative on checking for addresses that do not get coded. If you send a bad address into Google it will try to find a lat/lon based on the postal code. This is not the case with the MP version I built.


Some things to keep ya thinking Smiley Happy

on ‎02-08-2010 07:54 AM
I've uploaded the files for anyone that wants to play with this mod Smiley Happy
by Bronze Super Contributor
on ‎02-08-2010 08:19 AM

Hi gene,


can you give us some help for mappoint integration of slx WEB for a german Prospect? You wrote hat your sample only works in North America.......




on ‎02-08-2010 08:31 AM
Actually you are in luck! The version that is up on the website has been updated to use Google as the GeoCoder which is not NA focused. You might have to tweak some of my code because of how your addresses are formatted but all in all Lat and Lon is Lat and Lon no mater where you live and this is another reason why I cover all addresses. The mod that is in the web product will work for you out of the box because I'm mapping off the Lat/Lon of the address. The GeoCoder might need a little tweaking and this is why I offer the source code for you. Check it out and post back your questions here. I'd like to learn what I need to do so that the system can handle more address types.
by Bronze Super Contributor
on ‎02-09-2010 06:18 PM
Gene, thanks for sharing the solution. However, after researching the Google API terms, specifically item "9. Permitted Uses Under Google's Licenses" I fear this is a breach of their agreement. More specifically see this : "your Maps API Implementation must not (b) operate only behind a firewall or only on an internal network (except during the development and testing phase).

I have submitted a request to Google and will hopefully get a reply that they are fine with us using this in an intranet/non-public solution but my interpretation from the terms is that they will want us to pay $10,000/year. Do you know otherwise?

Terms are here:

Timmus Agersea
Customer Systems, Inc.
Register Read Guidelines Request Partner or Employee Access

What's New in 8.1