You are here

function gm3_load_geophp in Google Maps API V3 7

Load the geoPHP library. This could be made optional, as not all features require the library.

This code is adapted from the geofield module.

6 calls to gm3_load_geophp()
gm3_get_map in ./gm3.theme.inc
Function to return a renderable array for a map.
gm3_is_valid_polygon in gm3_field/gm3_field.module
Ensure the text for a single polygon is valid
gm3_region_get_points in gm3_region/gm3_region.callback.inc
gm3_region_get_points
gm3_region_get_region_id_from_latlng in gm3_region/gm3_region.callback.inc
Get the region_id from the lat,lng and zoom
gm3_region_install in gm3_region/gm3_region.install
Implementation of hook_install().

... See full list

File

./gm3.module, line 309

Code

function gm3_load_geophp() {
  static $filename = FALSE;
  if (!$filename) {

    // Folk can install geoPHP using a "libraries" path, or simply shove it in
    // the gm3 module folder.
    if (function_exists('libraries_get_path')) {
      $library_folder = libraries_get_path('geoPHP');
      if (!$library_folder) {
        $library_folder = libraries_get_path('geophp');
      }
      $file = $library_folder . '/geoPHP.inc';
    }
    else {
      $file = drupal_get_path('module', 'gm3') . '/geoPHP/geoPHP.inc';
    }
    if (file_exists($file)) {
      if (include_once $file) {
        $filename = $file;
      }
    }
  }
  return $filename;
}