GMap and Location Modules installed and enabled on Drupal 7:

GMap 7.x-1.x-dev
GMap Location 7.x-1.x-dev
GMap Macro Builder 7.x-1.x-dev
Location 7.x-3.x-dev

This error may be related to http://drupal.org/node/744426 and the gmap_plugin_style_gmap.inc file but I haven't been able to figure out the issue.

I opted not to use Node Location or Location CCK and instead have created my own fields to store street, city, state, zip, latitude, longitude and want to choose those fields to create the map view.

I created a node view using

View Defaults:

Filter by Node:Type
Fields:
Node: Title
Fields: Street
Fields: City
Fields: State
Fields: Zip
Fields: Latitude
Fields: Longitude
Node: Nid Nid

Page Display for View:

Style: GMap

Style Settings:
Grouping filed = None
Data Source = "Choose latitude and longitude fields"
Latitude Field = Fields: Latitude
Longitude Field = Fields: Longitude
Marker Handling = Use single marker type
Marker/fallback marker to use = Drupal

The result is a map page with no markers.

If I switch the Style

Style: Extended GMap

Style Settings:
Latitude Field = Marker latitude (Fields and Purposes)
Longitude Field = Marker Longitude (Fields and Purposes)
Grouping Field = None
Marker Click Action = Show formatted row in bubble
Marker Type = Small Red
Marker Handling = Use single marker type
Marker/fallback marker to use = Drupal

The result is the map displays with the marker and a opens the "bubble" when it's clicked. However I get the following notice:

Notice: Undefined index: in template_preprocess_gmap_views_view_gmapextended() (line 53 of Z:\xampp\htdocs\D7\sites\all\modules\gmap\gmap.views.inc).

Files: 
CommentFileSizeAuthor
#13 1077850.patch507 bytesgarrettrayj
#3 export of view.txt15.47 KBsilverflame757

Comments

I was able to fix the error I got when using Extended GMap Style.

Error was:

Notice: Undefined index: in template_preprocess_gmap_views_view_gmapextended() (line 53 of Z:\xampp\htdocs\D7\sites\all\modules\gmap\gmap.views.inc).

The fix:

On lines starting at line 50 on gmap.views.inc I replaced

  foreach ($renders as $i => $row) {
    $markers[$i] = $options['fallback_values'];
    foreach ($options['field_purposes'] as $field => $purpose) {
      $markers[$i][$purpose] .= $row[$field];
    }
  }

With

  foreach ($renders as $i => $row) {
    $markers[$i] = $options['fallback_values'];
    foreach ($options['field_purposes'] as $field => $purpose) {
      if (!isset($markers[$i][$purpose])) {
        $markers[$i][$purpose] = '';
      }
      $markers[$i][$purpose] .= $row[$field];
    }
  }

I still need help with a fix when using GMap Style.

I think I could have the same or a very similar issue as described here. I too have chosen to avoid using the location module (as I only need latitude & longitude) and created decimal fields to store my longitude and latitude, then choosing "choose longitude and latitude fields" and specifying accordingly in the view config.

I don't get any errors, but my view is showing my markers at what I can only think is position 0, 0 just off Nigeria when they should be in the UK.

I have the same configuration, but using a cck decimal field in a Drupal 6 version of the site and this works fine.

I tried the code at #1, but this did not make any difference for me.

StatusFileSize
new15.47 KB

The patch at #1 is for using Style: Extended GMap

Here is an export of my D7 view using Style: GMap and fields of type: float, instead of the location module. The latitude/longitude values appear like this: 41.636800 / -70.539100

The markers appear in the Gulf of Guinea instead of it's position in the US.

Attached is an export of my view.

Same issue as #2 here.

Worked fine in 6 but ported twe whole website today to 7 and having troubles.

I've setup 2 CKK decimal fields to my node, lat and lon.
Having setup my view properly the js script for loading the markers shows "markers":[{"latitude":15,"longitude":15, for nid 15 , "markers":[{"latitude":16,"longitude":16, for nid 16 and so on...

MAP is show but MArker are not ????

Hello Silver, its hapenning the same to me. Using gmap, I can see the location of the mark in Guinea.

And, Using extended gmap, I'm getting the follow error:

'Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column \'latitude\' in \'field list\

And yes, I assign the correct (or I think correct) fileds to latitude and longitude (both float fields)

Any solution or you don't have done work it yet?

The code in #1 fixed my notice:

Notice: Undefined index: i template_preprocess_gmap_views_view_gmapextended() (rad 53 av /home/test/public_html/sites/all/modules/gmap/gmap.views.inc).

Superscribe.

I was able to show markers by using the Extended GMap style rather than the regular GMap style in Views. With the regular style, it was showing markers for nodes that didn't even have data in the latitude and longitude fields even after clearing the caches. Weird.

Status:Active» Needs review

I was also getting "Notice: Undefined index:" with some views using Extended GMap and the change in #1 fixed my issue.

Changing the status of this to "needs review" because of the possible fix by silverflame757 in #1.

I dont know how much time I spent trying to get gmap to work like it should but with no luck. If I use my own lat/lon fields it simply dosent work marker is somewhere in the emptiness. I tried with decimal field also with simple text field. Not sure what else I could do.

this is what i found in js code ","longitude":"0","latitude":"40"}}});" and it makes no sense at all.

I'll just bump this since it a very old issue.

Version:7.x-1.x-dev» 7.x-2.x-dev
Status:Needs review» Needs work

can You provide a patch against latest dev?

StatusFileSize
new507 bytes

The solution from comment 1 worked for me. Here is a patch for 7.x-2.x.

Status:Needs work» Fixed

thanks

commited pushed to 7.x-2.x and backported to 7.x-1.x

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

I was having a similar problem, where using separate longitude / latitude fields did not work, but I added the location field to the view and used it for the latitude and longitude with the default (address) widget and it's working!

Status:Closed (fixed)» Active

Same thing happening here. I have a view with a map, where the latitude and longitude are part of a field of type location, and I'm not able to show the map with the marker.

I've tried with the GMap display, and Extended GMap setting the latitude and longitude, but the map is showed but no the marker.

Please help, I don't know what else to check.

@taote Did you try what I mentioned in #16? Maybe I didn't explain it well. I have a location field called "Map" that uses a map on the node edit page to set the location. Then in the view I added my Map field, excluded it, and set the Formatter to "Default (address)". I'm using the regular Gmap format for the view, and in the settings I have the Data Source set to Choose latitude and longitude fields, with the Latitude set to Field: Map and the Longitude set to Field: Map.

@Codigo Vision. Thanks for your reply. I did what you mentioned, and the marker is still not showing, but I've checked the option "Highlight marker on rollover" and when I hover the mouse over the location on the map where the marker should be, I can see a red circle, so the map it's locating the marker but not showing it. I've tried everything, I don'tknow what else to do.

Besides on the edit form, the marker is shown on the map, so I don't understand why not on the view.

@taote I have not experienced that issue before. You might want to look into some of the other marker issues or open a separate issue. The only thing that comes to mind is that it could be a Javascript error blocking the marker from loading. You might want to use the console to check for errors. Ctrl+Shift+i in Chrome or F12 Firefox.

I have compared the source code of the page where the map is rendered and the marker is not shown, and the one on the edit form where the marker is visible. And here are the differences:

Code for the marker in the map built by the view

<div style="width: 20px; height: 34px; overflow: hidden; position: absolute; opacity: 0.01; cursor: pointer; left: 444px; top: -32px; z-index: -3;" class="gmnoprint" title="">
      <img style="position: absolute; left: 0px; top: 0px; -moz-user-select: none; border: 0px none; padding: 0px; margin: 0px; width: auto; height: auto;" src="http://maps.gstatic.com/mapfiles/transparent.png" draggable="false">
</div>

Code for the marker in the map in the edit form

<div style="width: 22px; height: 40px; overflow: hidden; position: absolute; opacity: 0.01; left: -11px; top: -40px; z-index: 0;" class="gmnoprint">
      <img style="position: absolute; left: 0px; top: 0px; width: 22px; height: 40px; -moz-user-select: none; border: 0px none; padding: 0px; margin: 0px;" src="http://mt.googleapis.com/vt/icon/name=icons/spotlight/spotlight-poi.png&amp;scale=1" draggable="false" usemap="#gmimap0"><map name="gmimap0" id="gmimap0"><area log="miw" coords="8,0,5,1,4,2,3,3,2,4,2,5,1,6,1,7,0,8,0,14,1,15,1,16,2,17,2,18,3,19,3,20,4,21,5,22,5,23,6,24,7,25,7,27,8,28,8,29,9,30,9,33,10,34,10,40,11,40,11,34,12,33,12,30,13,29,13,28,14,27,14,25,15,24,16,23,16,22,17,21,18,20,18,19,19,18,19,17,20,16,20,15,21,14,21,8,20,7,20,6,19,5,19,4,18,3,17,2,16,1,14,1,13,0,8,0" shape="poly" title="" style="cursor: pointer;"></map>
</div>

So the marker is there and positioned, but I don't know why the marker in the map is a transparent png, when I have selected the red arrow. Any ideas?

Ok, it works when I select in the GMap options Default for Marker / fallback marker to use. The problem is when I want to use a different marker.