I just found the module and it looks great. Love the concept.

To bridge the gap between being limited to just the blocks, how about adding an option to include these into the content via filter tags. This would allow you to add the maps to almost anything! Here is the implementation that I used to do this on a project that I am working on:

<?php

/**
 * Implementation of hook_filters().
 */
function isis_filter($op, $delta = 0, $format = -1, $text = '', $cache_id = 0) {
  switch ($op) {
    case 'list':
      return array(
        0 => t('Include a google map block.'),
        );

    case 'description':
      switch($delta) {
        case 0: return t('Include a google map block using the tag, [gmap-block:XXX]');
      }

    case 'prepare':
      return $text;

    case 'no cache':
      switch ($delta) {
        case 0:
          return TRUE;
      }
    case "process":
      switch($delta) {
        case 0: return preg_replace_callback('/\[gmap\-block:([^\]]*)\]/', '_isis_gmap_block_replacer', $text);
      }


  }
}

function isis_filter_tips($delta, $format, $long = false) {
  switch($delta) {
    case 0: return t('[gmap-block:XXX] - insert the google map block that has the ID of XXX. For example, [gmap-block:1].');
  }
}

function _isis_gmap_block_replacer($matches) {
  if (is_numeric($matches[1])) {
    module_load_include('content.inc', 'gmap_blocks');
    if ($block = gmap_blocks_content($matches[1])) {
      return $block['content'];
    }
  }
  return '';
}
?>

Comments

alan d.’s picture

Just a sanity check for entering a wrong gmap-block id into the filter code:

<?php

function gmap_blocks_content($delta) {
  $path = drupal_get_path('module', 'gmap_blocks');
  $block = gmap_blocks_block_load($delta);
  if (empty($block)) {
    return NULL;
  }
  //...
}
?>

We have used this filter on 4 sites to date. It is a really nice feature to enable users to embed gmap blocks on their "contact us" page.

skilip’s picture

Status: Active » Postponed

This definitely would be a cool feature. However, I'm not going to take this into the current release while it would delay the already too much delayed release of this module. Postponing this issue to the next release.

mstrelan’s picture

@skilip - The code is already available, why not stick it in the module, at least as a dev version? I have used this on at least 5 sites and it works a treat. Additional features could include "left" and "right" in the token, and you could include css classes to float these.

alan d.’s picture

Version: 6.x-1.0-beta3 » 6.x-1.0

pinging.....

meichr’s picture

+1 subscribing

alan d.’s picture

Status: Postponed » Active

bumping as we start a multisite implementation with another hacked version of the module....

Ela’s picture

subscribing

mstrelan’s picture

Status: Active » Closed (outdated)