Creating a view with a style of GMap, creates blank content! No map, no nothing. More than unusable!

Views 6.x-2.7
Location 6.x-3.1-rc1
GMap 6.x-1.x-dev

Is this GMap a very fragile module?

Comments

Remco’s picture

You allready added some markers? Cause my experience with it is that it doesn't show a map if there are no markers.

sderrick’s picture

Of the 600+ nodes that have a cck location field, about 100 of them have lat/longs and show a marker on the edit page that exposes the gmap location picker. The others have a lat/long of 0(zero). I had somebody else doing data entry and they didn't notice that the entreis were not being assigned a lat/long. I enabled gmap and registered for an API key and now all new entries are generating a lat/long. the other 500+ have to be manually added. The module says if the lat/long field is left balmk it will generate one but that doesn't work either.

Scott

sderrick’s picture

Well after a bit of sluething in the sql database I have found that the query run to populate the map, will never return the right lat/longs!

SELECT node.nid AS nid, node.title AS node_title, location.latitude AS gmap_lat, location.longitude AS gmap_lon FROM node node LEFT JOIN location_instance location_instance ON node.vid = location_instance.vid LEFT JOIN location location ON location_instance.lid = location.lid WHERE (node.status <> 0) AND (node.type in ('school_listing'))

returns a list of entries with all lat/longs set to 0/0!!!

using one entry these are the entries for each table

node table : nid=56 vid=805 type=school_listing title= Moorpark College status=1

location table : lid=510 latitude=34.283551 longitude=-118.873940

location_instance table : nid=0 vid=0 genid=cck:field_location:805 lid 510 (in this table all the nid & vid entries are 0(zero)? )

if node.vid = location_instance.vid, it will never find the correct location table. Interesting that the location_instance.genid has the correct id at the end of cck:field_location:805 correct id

And why are all the location_instance nid's and vid's 0(zero)?

sderrick’s picture

Priority: Critical » Normal
Status: Active » Closed (duplicate)

I upgraded the Location module to the 6.x.3.x..dev release fromthe rc release

in the view
added a relationship to the cck location field in the content type node
added two fields from the relationship of type location:latitude location:longitude
changed the style gmap's data source from location.module to Choose Lat Long and chose location:latitude and location:longitude

WooHoo!!!!!

The baloon's are empty when you click on a marker, but i'm so much closer to a working map!

Scott
edit · reply

giorgosk’s picture

Status: Closed (duplicate) » Fixed

duplicate to what ?

the relationship saved my life but I can only see
latitude
longitude empty in the info window

did you actually get it to show something meaningful ?

Status: Fixed » Closed (fixed)

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

capellic’s picture

Wow... when did they spring this change? I use GMAP with Views on at least 3 sites a year and this is the first time I've had to configure the View this way. Are there are any docs on this?

Now that I think about it, I'm using the Location module differently this time which might be attributable to my confusion. I usually just use the node location implementation, but this time I am using the CCK fields for location. That's probably the difference.

grasmash’s picture

I'm having this same problem. I set the longitude and latitude fields the same way you did, but I don't quite understand what you did with relationships. Can you please explain in more detail?

grasmash’s picture

Go to this post and read comment #4 and #8. Solves the issue.
http://drupal.org/node/386848

Also make sure that you've got your Google Maps API set up correctly as per the gmap instructions.

shaneonabike’s picture

Same goes no longtitude and latittude resulted in no map being displayed.

Suggestion: Perhaps still display the map with a message indicating there weren't any results?