You are here

function _gmap_cck_get_gpx in GMap Addons 7

Same name and namespace in other branches
  1. 5 gmap_cck.module \_gmap_cck_get_gpx()
  2. 6 gmap_cck.module \_gmap_cck_get_gpx()

process gpx-parameter to show something on the map

2 calls to _gmap_cck_get_gpx()
gmap_cck_field_formatter in ./gmap_cck.module
Prepare an individual item for viewing in a browser.
gmap_cck_widget in ./gmap_cck.module
Define the behavior of a widget.

File

./gmap_cck.module, line 492
display of a google map as cck field

Code

function _gmap_cck_get_gpx(&$settings, &$field, &$node) {
  require_once 'gmap_gpx.inc';
  if ($settings['gpx']['type'] == 'file') {
    $f = $settings['gpx']['file'];
    if (!file_exists($f)) {

      // was in temp location last time we looked?
      if (!isset($field) || !isset($node)) {
        return false;
      }
      if (!_gmap_cck_check_gpx_source($settings, $field, $node)) {
        return false;
      }
      $f = $settings['gpx']['file'];
    }
    gmap_gpx_parse_file($f);
    gmap_gpx_data2map($settings);
    gmap_gpx_cleanup();
  }
  unset($settings['gpx']);
  return true;
}