Google Map with Multiple Locations

Posted by Rollbase User on 07-Feb-2012 15:38

I'm trying to reuse the code from the Google Maps to show multiple markers on one map, pulling dynamically from a list of records in an object view. I have an object that has a one to many relationship to the location object and attempted to create a new generic tab under the object's main page with a script component containing the google map code referenced at http://getsatisfaction.com/rollbase/topics/google_map_in_view_page with a loop and template fields. Unfortunately, nothing comes back and I think it's because I'm not viewing a specific records, I'm viewing the entire list of records within the object. Is there a way to loop through related records for an object in a specific view (or with a SELECT query) and show every marker returned on a Google Map? I think the answer lies in using the API but I wanted to ask if there's something I'm missing first and then some help with the API call.

All Replies

Posted by Admin on 07-Feb-2012 18:47

Hi,



You actually don't need a query if the location data you are using does not need to be dynamic, i.e, generate map markers from a custom search tool.



Here is what I did (code below):

Posted by Admin on 07-Feb-2012 18:50

Additionally, you'll have to acquire a Google Map API Key from Google Maps to make it work or it will alert an error every time your try to run it =)

Posted by Admin on 08-Feb-2012 14:48

Martin,



Thanks so much, this really helped out!



If someone else is following this, the only thing I had to change was in the LOOP_BEGIN statement. It should be {!#LOOP_BEGIN#all.VIEWID} instead of {!#LOOP_BEGIN.objname#all} like you have above. Otherwise, it's working perfectly!



Thanks,

Frank

This thread is closed