CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Google Maps integration
Pages: [1]

Author Topic: Google Maps integration  (Read 7269 times)

backdrifting

  • I post frequently
  • ***
  • Posts: 178
  • Karma: 2
Google Maps integration
November 07, 2008, 08:21:42 am
I have mapping working successfully with my Google Maps API key.  Is it possible to add a link for "Get Directions" that would link out to Google for the actual location directions?  Has anyone done this yet in CiviCRM?

-backdrifting

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Google Maps integration
November 07, 2008, 05:40:52 pm
I think by default CiviCRM adds "Get Directions FROM:" option.
Check http://drupal.demo.civicrm.org/civicrm/contact/map?reset=1&cid=105&lid=1

Kurund
Found this reply helpful? Support CiviCRM

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Google Maps integration
November 09, 2008, 08:33:50 pm
Not from what I can see.
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

mcsmom

  • I post frequently
  • ***
  • Posts: 266
  • Karma: 23
    • Official Joomla! Book
  • CiviCRM version: 4 and 3.4
  • CMS version: Joomla!
Re: Google Maps integration
December 01, 2008, 07:27:02 am
On my map if you click on the pin it gives you a pop up where you can put a second address for directions.

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Google Maps integration
December 01, 2008, 10:35:57 am
Huh - maybe I need to upgrade my glasses  ??? Yep - there and working
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

mcsmom

  • I post frequently
  • ***
  • Posts: 266
  • Karma: 23
    • Official Joomla! Book
  • CiviCRM version: 4 and 3.4
  • CMS version: Joomla!
Re: Google Maps integration
December 02, 2008, 11:16:09 am
Is there anyway to force a certain zoom level? My map tends to open up to the middle of the ocean.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Google Maps integration
December 02, 2008, 01:13:59 pm

this should not happen for most reasonable addresses. Can you reproduce this on the demo server.

middle of the ocean most likely means, we geo-coded the address to a lat/long of 0/0

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

mcsmom

  • I post frequently
  • ***
  • Posts: 266
  • Karma: 23
    • Official Joomla! Book
  • CiviCRM version: 4 and 3.4
  • CMS version: Joomla!
Re: Google Maps integration
December 02, 2008, 02:02:41 pm
Lobo, I'm sorry I wasn't clear, I meant when I am mapping all contacts.

http://opensourcematters.org/index.php?option=com_civicrm&task=civicrm/profile/map&map=1&gid=5&reset=1


goran

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 3
Re: Google Maps integration
December 19, 2008, 02:12:43 pm
I think I was after the same as you. Editing the civicrm/templates/CRM/Contact/Form/Task/Map/Google.tpl

48c48
<                 map.setZoom(5);
---
>         map.setZoom(map.getBoundsZoomLevel(bounds));
50c50
<         map.setZoom(15);
---
>         map.setZoom(6);

did the trick for me. Now the map zooms to all results.
Also I have changed the default zoom level for single contact to suit our needs.

We work with contacts from around the world and even when looking at the single contact most times it makes sense for us to get an idea where in the world we are (for us it is easier to zoom in). At the same time if we were mostly working in a certain area then some other zoom level for single contact would make more sense. Maybe the default zoom level should be configurable.

Now if I could find my newbie way around to making a map fill a bigger area - depending on the size of the browser - I'd be a happy puppy.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Google Maps integration
December 19, 2008, 02:25:19 pm

hey goran:

any specific reason you did not use: map.setZoom(map.getBoundsZoomLevel(bounds));

for both cases, and allow google to decide an appropriate zoom level to show all contacts?

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

goran

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 3
Re: Google Maps integration
December 19, 2008, 02:49:57 pm
hey lobo:

as far as I understand the 1st case is a single point ( count($locations) )?
if so then we have a single point and for the single point a default zoom is a matter of preferrence (you might want to see neighbourhood, district, county, countr, etc..)

also, i managed to get my fingers around what I wanted... full diff is:
15a16,17
>       GEvent.addListener(map, 'resize', function() { map.setCenter(bounds.getCenter()); map.checkResize(); });
>
48c50
<                 map.setZoom(5);
---
>         map.setZoom(map.getBoundsZoomLevel(bounds));
50c52
<         map.setZoom(15);
---
>         map.setZoom(6);
78c80
<   <div id="google_map" style="width: 600px; height: 400px"></div>
---
>   <div id="google_map" style="width: 100%; height: 450px"></div>

Now the map fills the available area and recenters on resize. Kept the height constant.
(am not sure about map.checkResize(), supposedly it might not be necessary and might cause problems on IE).


Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Google Maps integration
December 19, 2008, 03:04:16 pm

cool. thanx for doing this :) i've added and modified the 2.1 version of Google.tpl :)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Google Maps integration

This forum was archived on 2017-11-26.