I'm trying to remove the street address right now from the Google Map that's created from Search Contact -> Map Contacts when you click on the people icons placed on the map. This is for privacy purposes, but I'm interested in adding some custom contact info there later.

I researched and found the Mapping Providers are at templates/CRM/Contact/Form/Task/Map. When I copied Google.tpl, renamed to GoogleCityOnly.tpl, and edited - it shows up as a selection in the Mapping and Geocoding system menu for Mapping Providers. But when I choose it and search contacts, the "Map Contact" no longer shows up.

What am I missing to have "Map Contact" show up again? Where's the guidance for making an alternate Mapping Provider?

  • Which CMS are you using?
    – Coleman
    Commented May 19, 2015 at 20:54
  • I'm using Drupal 6.35 Commented May 26, 2015 at 1:05

1 Answer 1

  1. When you select Google as the map provider, I assume the Map Contact shows up.

  2. Ensure that When you select GoogleCityOnly, you also retain the Google Map API Key. The code checks for the presence of both a mapping provider and a mapAPIKey before displaying the Map Contact link

  3. If you want to "modify" the code to avoid the Map API key for now, check: CRM/Contact/Selector.php and search for mapAPIKey

  • Thanks Donald. When I choose Google as map provider, Map Contact does show up. I'm not understanding why the Google Map API Key should make a difference, since it is an empty field. I'm not using it. But I did try deleting the check for the mapAPIKey in Selector.php. That didn't work. I even tried forcing the code to add the item - but it still doesn't show up. //if ($config->mapProvider) { self::$_links[CRM_Core_Action::MAP] = array( <deleted code> 'title' => ts('Map Contact'), ); //} Commented May 22, 2015 at 17:52
  • The mini-Markdown didn't work - but the last bit was showing where I commented out "if ($config->mapProvider) {", after deleting "$config->mapAPIKey &&"/ Commented May 22, 2015 at 18:05
  • Ok - one last comment - I think I need guidance about how to copy the Google.tpl file. I'm pretty sure my edit was good, but I tried removing my edits to change the output, and just have GoogleCityOnly.tpl have the exact same content as Google.tpl. I can select "GoogleCityOnly" in System Settings. But "Map Contact" does not appear in the batch choices. Commented May 22, 2015 at 18:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.