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) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • adding kml overlays to map
Pages: [1]

Author Topic: adding kml overlays to map  (Read 2919 times)

critical15

  • Guest
adding kml overlays to map
July 24, 2007, 10:19:59 pm
Hi folks!
I'm trying to figure out how to add a simple KML overlay to the "Map Locations" feature in CiviCRM.  What I'm really looking for is the PHP code which produces the "map contacts" page.  Adding KML overlays would be easy, if I could just get to the PHP script that produces the html.  Any advice?


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: adding kml overlays to map
July 24, 2007, 10:34:26 pm

CRM/Contact/Form/Task/Map.php

and

templates/CRM/Contact/Form/Task/Map/Google.php

are the files of interest. Please do report back on your explorations with KML and integration etc

thanx

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

critical15

  • Guest
Re: adding kml overlays to map
August 05, 2007, 11:12:22 pm
This worked great lobo, I just changed the templates/CRM... files to include the simple includes:

Code: [Select]
      var geoXml = new GGeoXml( KML FILE );
      map.addOverlay(geoXml);

and then threw in the javascript to toggle them on and off.

In fact, this tells me that it would be pretty easy to update the module/component for mapping to call in KML files.  In our site, we're geocoding contacts, overlaying an electoral precinct map, and assigning each contact their precinct judging by which polygon they fit in. 

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: adding kml overlays to map
August 05, 2007, 11:17:57 pm

is there a demo that we can check the below out? sounds quite cool :)

Do you assign a precinct automatically or is this a manual process? yeah, extending it to include an optional KML file will be quite trivial. if interested, I can help you out on IRC

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) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • adding kml overlays to map

This forum was archived on 2017-11-26.