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) »
  • Proximity Search - Map Contacts - Default Zoom Level
Pages: [1]

Author Topic: Proximity Search - Map Contacts - Default Zoom Level  (Read 1845 times)

davidunwinubs13

  • I post occasionally
  • **
  • Posts: 41
  • Karma: 1
    • Marylebone Association
  • CiviCRM version: 3.3.6
  • CMS version: Drupal 6
  • MySQL version: 5
  • PHP version: 5
Proximity Search - Map Contacts - Default Zoom Level
February 16, 2011, 08:31:20 am
We use CiviCRM for our local residents association. We find the proximity search really useful for finding contacts within a small radius (100-150 meters). As it is small geographic area in which we operate with a lot of contacts (over 1800) searches can throw up a lot of contacts in a small area. When we Map Contacts on the search the resulting map is not clear as all the contacts are bunched together due to the default zoom level and we can't zoom in as we are maximum zoom, but we can zoom out. Is there a parameter where we can change the default zoom value when the map is first displayed?

On a Contact record display when we click on the map icon in the contact record, the zoom level is down at the lowest level and we could do with changing that to zoom out a little bit as default.

rjb

  • I post occasionally
  • **
  • Posts: 63
  • Karma: 2
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6
  • MySQL version: 5.1.44
  • PHP version: 5.3.1
Re: Proximity Search - Map Contacts - Default Zoom Level
February 17, 2011, 04:11:42 am
You can edit the zoom level in the relevant tpl files - just view source to find which tpl is called for any given page, then be sure to edit a parallel copy saved within your custom templates directory.

Hope that helps,

RJB

sushant

  • I post frequently
  • ***
  • Posts: 126
  • Karma: 8
  • CiviCRM version: v3.2.x,v3.3.x v4.0.x, v4.x,trunk
  • CMS version: Drupal 6/7 ,joomla 1.5,1.6
  • MySQL version: 5.1.51
  • PHP version: 5.3.3
Re: Proximity Search - Map Contacts - Default Zoom Level
February 17, 2011, 04:55:30 am
Hi davidunwinubs13,
rjb is right you need to edit  /templates/CRM/Contact/Form/Task/Map/Google.tpl file .
Following line  which is use to set defaultzoom value (around line -33 )

Code: [Select]
{assign var=defaultZoom value=12}
Hth
Sushant.
CiviCRM Priority Support
http://support.civigardens.com/
http://osseed.com

davidunwinubs13

  • I post occasionally
  • **
  • Posts: 41
  • Karma: 1
    • Marylebone Association
  • CiviCRM version: 3.3.6
  • CMS version: Drupal 6
  • MySQL version: 5
  • PHP version: 5
Re: Proximity Search - Map Contacts - Default Zoom Level
February 23, 2011, 09:46:56 am
I tried changing the zoom which was set to 12 to other settings ie 10 and 14 and it did not make any differences. Are there other tpl files I should be changing? I have just changed the google.tpl file as we use google for the mapping.

demeritcowboy

  • Ask me questions
  • ****
  • Posts: 570
  • Karma: 42
  • CiviCRM version: Always the latest!
  • CMS version: Drupal 6 mostly, still evaluating 7.
  • MySQL version: Mix of 5.0 / 5.1 / 5.5
  • PHP version: 5.3, usually on Windows
Re: Proximity Search - Map Contacts - Default Zoom Level
February 23, 2011, 10:42:14 am
Farther down in the file look for map.setZoom. There are two places where it doesn't use the default zoom and instead I think it's trying to calculate the appropriate zoom level but I've noticed that it doesn't seem to work. Replace those with map.setZoom({$defaultZoom})

davidunwinubs13

  • I post occasionally
  • **
  • Posts: 41
  • Karma: 1
    • Marylebone Association
  • CiviCRM version: 3.3.6
  • CMS version: Drupal 6
  • MySQL version: 5
  • PHP version: 5
Re: Proximity Search - Map Contacts - Default Zoom Level
February 23, 2011, 11:08:11 am
Hi guys,
Thanks for that. I have not changed the other parts of the code as suggested yet, but I found the following:
When the Google map displays you have three selection boxes in the top right hand side of the map,
Map, Satellite, and Terrain.
By default Map Contacts  displays the Terrain version of the map.

If you click on the Map selection to show the street names, The zoom level changes to what you specify in the Google.tpl file.
So this seems a good workaround. :)
Thanks guys for all your help on this

David
« Last Edit: February 23, 2011, 11:36:18 am by davidunwinubs13 »

planetwebb

  • I post occasionally
  • **
  • Posts: 62
  • Karma: 2
  • CiviCRM version: 4.5.8
  • CMS version: Joomla 2.5.28 / Drupal 7.34
  • MySQL version: 5.5.34-cll-lve
  • PHP version: 5.3.22
Re: Proximity Search - Map Contacts - Default Zoom Level
April 15, 2012, 06:35:00 pm
I made two changes:

Line 33: value=18 <== or whatever you're looking for to provide depth of zoom

Line 41: map.setMapTypeId(google.mapsTypeId.ROADMAP)  <== changed from TERRAIN based on David's hint

I found the map types here:
https://developers.google.com/maps/documentation/javascript/maptypes

This works great for me.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Proximity Search - Map Contacts - Default Zoom Level

This forum was archived on 2017-11-26.