The module installs without a hitch but after creating a new field type to use with new content types drupal shows white when I try to click on content previously created. This only affects the viewing of the site and not the administration page. Could this be a php memory allocation problem?

log file reports:

PHP Fatal error: Call to undefined function link_views_content_field_data() in /Applications/MAMP/htdocs/drupal/sites/all/modules/gmapfield/gmapfield.module on line 216

CommentFileSizeAuthor
#18 views_list_result.jpg273.1 KBpetarb

Comments

zzolo’s picture

Title: white screen of death after a new field is created using Gmap Field » Views Support
Assigned: Unassigned » zzolo
Category: support » feature

Is this in a View? I have not really looked at Views support yet. I'll put it on the queue.

If this is not a View, I think this could be solved by installing Views. I had started the Views support but did not finish it.

zzolo’s picture

Regular Views support is in latest. But since the node is not passed along, there are no points or markers yet.

ozchris’s picture

I get this error:
Fatal error: Call to undefined function link_views_content_field_data() in /home/mysite/public_html/mydomain.com/sites/all/modules/gmapfield/gmapfield.module on line 216

If I turn off gmapfield module, all is ok.
If I turn it on, all views fail.

Bit of a bummer.

edited to add: running drupal 6.4.

zzolo’s picture

Are you at the newest dev release (Nov 10)?

ozchris’s picture

i just took a copy of my production site and installed it on a localhost xampp setup on my laptop.
Same thing happens - as soon as i turn on gmapfield, i get the above error for all views.

i upgraded the local version of the site from 6.4 to 6.6 and the same thing happens.

but after your last post, yes i was running a version from 9 november. just downloaded 10 november and it works, even in prod with 6.4

big thank you!

mojipittan’s picture

Thanks for the update on the nov 10th but again, I think this is a views related problem. after the update I get the following error

PHP Fatal error: require_once() [function.require]: Failed opening required './sites/all/modules/cck/theme/theme.inc' (include_path='.:/Applications/MAMP/bin/php5/lib/php') in /Applications/MAMP/htdocs/drupal/sites/all/modules/cck/content.module on line 180

I am not sure if this is a related problem, but I am currently using drupal 6.6 with cck 6.x-2.0. Do you have a recommended module version configuration that best works with your latest version?

zzolo’s picture

@mojipittan:
This does not look like a problem that is caused by gmapfield module. Did you move anything around or change permissions?

This module was developed by using the most recent version of CCK (2.0).

mojipittan’s picture

@zzolo:
I have given permission to view all users to view field created using the gmap_field modules. I think I have allowed permissions to related fields, including gmap, and locations module but I agree with you, it might be a views related problem.

apologize for the late response,
may I ask what your setting and requirements are for gmap_field to work?
at its current stage in development, is it best to use it without enabling the views module?

Cheers!

zzolo’s picture

@mojipittan

At the moment, Views "works". I have not tested this with many different configurations. Right now, the map will show up, but the markers will not. I know there may be need to have a list of maps, but I would suggest using the built-in GMap Views plugin that will aggregate Location points and put into one map.

mojipittan’s picture

@zzolo:

thanks, I am a still a bit new playing with google map mashups, so having a bit of difficulty playing with drupal 6. I get the feeling that drupal 5 is better supported in this area but I will continue to follow gmap field.

slightly off topic, but is there a way to create a mashup like this one

http://drupal.org/node/209180

using what is available in drupal 6?

I have been following a lot of tutorials that suggest using gmap macro, in order to generate maps which seems a little long winded method in order to create a content type that can take in location details and automatically generate a map with a marker for that location.

any hint or advice is deeply appreciated.

Thanks!

tonycpsu’s picture

Subscribing.

petarb’s picture

I would love to see full Views Support if possible. Does anyone have any further insights to this?

theabacus’s picture

Also interested in Views support. Subscribing...

zzolo’s picture

Hi. Please note that this module is "seeking new maintainer", which means I don't have much (or any) time to put towards this module. Patches are very welcome.

petarb’s picture

Understood zzolo.

I would like to offer a bounty to someone to fix this issue, however I have no idea about protocol to do this. Anyone who would be interested could get in contact or I could just offer a sum here?

zzolo’s picture

Hi @PetarB. I don't think there's any sort of official protocol to do such a thing. I personally don't have any time at the moment, but will mention it to others. Can I ask, what exactly you are looking for with "Views support" with this module?

petarb’s picture

I would like to show an individual map for each result from views, in a non-aggregated fashion. It's not the best solution, however a client is extremely interested in using this result.

Attached is an image with the current default Gmap Field view module in use in the Views result. The map renders, however it is not centered on the field result, and a marker does not show. Exactly as claimed! ;)

I need the marker for the location to appear, and if it does, I'm assuming the Gmap macro will take care of centreing it as well, similar to what it does on all other renderings of gmaps on the current site.

Please do not comment on the 'design' of the page, it's not mine, I would have done something different.

Note: can't upload a pic at the moment, no idea why. Will try uploading a pic later.

petarb’s picture

StatusFileSize
new273.1 KB

Now with added attachment!

petarb’s picture

If anyone is interested in the bounty, see here:

http://drupal.org/node/975970

petarb’s picture

The bounty has been claimed, and here is the solution:

The final function in file gmapfield.module just needs to be replaced as follows.


<?php
/**
 * Function to get markers
 *
 * @params $node
 *  Node object loaded so far
 * @params $field
 *  Field data
 * @return
 *  Associative array to merge into a gmap array
 */
function _gmapfield_get_markers($node, $marker, $field) {
  $loc_data = array();

  // Check for datasource
  if ($field['coordinate_datasource'] == 'location') {
    // Check Markers
    $available_markers = gmap_get_marker_titles();
    if (!array_key_exists($marker, $available_markers)) {
      $marker = 'drupal';
    }
    $node = node_load($node->nid);
    // Check for locations
    if ($locations = $node->locations) {
      $count = 0;
      foreach ($locations as $l) {
        // Check for lat and long first
        if ($l['longitude'] != 0 && $l['latitude'] != 0) {
          // Add markers
          $loc_data['markers'][] = array(
            'text' => theme('gmapfield_markerwindow', $l, $node),
            'longitude' => (float) $l['longitude'],
            'latitude' => (float) $l['latitude'],
            'markername' => $marker,
            'offset' => $count,
          );
          // Set center if primary or first location
          if ($l['is_primary'] || $count == 0) {
            $loc_data['longitude'] = $l['longitude'];
            $loc_data['latitude'] = $l['latitude'];
          }
          $count += 1;
        }
      }
    }
  }
  elseif ($field['coordinate_datasource'] == 'cck_fields') {
    $loc_data = array();
  }
  return $loc_data;
}

?>

I have tested it using gmapfield-6.x-1.0-beta and it works as expected.

I'm no coder, so zzolo, if you have some spare moment to put this into the official module and resubmit (I have no idea of the procedure to do this), I think everyone would be grateful, as it adds a very useful feature. If you don't have time to do this, let me know and I'll give it a go...

Big thanks to jvizcarrondo for the solution. Hopefully it was easy money!

Regards, Petar

zzolo’s picture

Hi @PetarB. Glad to hear this is working our for you. I will try to put this in soon. It will happen faster if you can supply a patch. See http://drupal.org/patch/create

lnunesbr’s picture

I'm not able to get this views integration working on my drupal 6 site... Actually, I've tried gmapfield beta1 and also beta1.

CCK 2.9
Views 2.12

But, It's working fine in the node page.

tribe_of_dan’s picture

This worked for me, great stuff!