Drupal 4.7.2
Enabled
gmap.module $Id: gmap.module,v 1.40 2006/07/08 03:49:00 webgeer Exp $ */
gmap_location.module
Disabled
location.module
location_views.module
Access controls enabled for gmap module: "create macro" (user 1 only)
Access controls enabled for gmap-location module: "show node map"
I am trying display a Gmap of nodes of a particular node type using Views module.
- I have created a new content/node type using flexinode, call it new-node-type.
- Flexinode access controls enabled for new-node-type: "create new-node-type" and "edit own new-node-type"
- I have enabled "Allow users to add Google Maps info to this node type" under settings for new-node-type.
- I "create content" to add some nodes of new-node-type. For each new node, a map appears and I click to set coordinates and I save each node.
- When I view the individual nodes, I confirm that the coordinates have been saved and the pin appears on the individual node map as expected. (Though the map is zoomed in more closely than I anticpated).
- I have created a view with which I intend to display a map of all new-node-type nodes.
- I have enabled "page view" and selected "view type" as "gmap view"
- I have two filters for the view. "Node published equals yes". And, "Node Type is one of new-node-type".
- When I view the new View, a Gmap is drawn on the page but there are no pins. What do I need to do differently to display the pins for new-node-type.
- Also, Views considers the "gmap view" "view type" to be a "list view" or "table view" and requires that I add fields. Is this expected behavior?
- Should I expect a list or table to display below the map? If so, there is none. Are added fields the fields that will display in the info window?
- Is there a way to display a "teaser list" below the gmap in this view? If not, I can work around it, I just need to know what it is I am expecting to happen.
Thanks for this great module!!
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | gmap_view.patch | 1.29 KB | Zack Rosen |
Comments
Comment #1
StuartDH commentedLooks like I've got the same set up as you, and unfrotunately I can't get gmap to show any markers from views.
node locations and user locations works fine. I'm on a clean site with only four nodes, all with locations, but even the most basic views - i.e. no filters etc - just shows the default map without markers.
Not really sure what's stopping it from happening, but otherwise this is one outstanding module and it's really well supported by webgeer (just look at all the green in the issues page :) ), so hopefully it won't be long before it's sorted
Comment #2
webgeer commentedI don't know much about the views functions for gmap. These were created by someone else (I'm sorry, but I haven't been able to look back through the old issues and figure out who). I only did minimal testing of it back then. (I believe it did display a marker for each node then).
If no one else is able to figure it out by next week I will spend some time then and see if I can figure it out. (I won't have any time between now and then to track this down). I would like to say thank you for your detailed description of the problem it is very helpful to get this when you are sorting out these kind of problems.
Comment #3
pcwick commentedI found this handbook article:
http://drupal.org/node/61335
I'm thinking the addition to the template.php is obsolete now that a Gmap view type is available in Views, but I'm not sure.
I also found this gmap issue titled "Views Integration"
http://drupal.org/node/62170
Here's another one:
http://drupal.org/node/62055
I hope this helps someone figure this out.
This may become relevant once this issue is resolved:
http://drupal.org/node/67029
StuartDH, I agree all that green is impressive! Thank you webgeer!
Comment #4
alanburke commentedI suspect it has something to do with locations module being disabled.
[I can't test this for a days, I'm away from my development machine]
When Zacker created his mashup [ he subsequently wrote the patch for a 'Gmap view', I believe] he had the location module enabled.
There could be some dependency on the location module somewhere down the line.
I'll get to test this further sometime later.
Alan
Comment #5
sqlwiz commentedI have this working with modules as of 6/15. I will try it with the current modules.
I believe you will need location and location_views enabled. You will need lat and lon stored in location.
There is no list or table displayed below the map. The fields in the view will show up in the info window triggered by clicking the map marker.
I am using CCK not flexinode - I do not know where your coordinates are being stored, if not in location.
Comment #6
gherikill commentedI have the same problem. Enabling the location module does not have any effect. I loved Zacker's tutorial and have been trying for days to reproduce it.
Comment #7
pcwick commentedThanks for your replies.
I originally disabled location and location_views due to this issue:
http://drupal.org/node/69243
Titled: independence of location.module
When adding a View with the new "independent" versions of gmap and gmap_location enabled, and location and location_view disabled, there is an option to select a gmap view type. For this reason, I am thinking location_view is not necessary to use a view type of gmap.
To test, I tried enabling location and location_views (along with gmap and gmap_location) and there are still no pins on the Views map. Also, when creating a new node of new_node_type, there is no map to click, but instead the location forms (i.e. city, state, zip, etc.). Coordinates are not computed and saved with all four modules enabled.
It appears the gmap and gmap_location modules are still storing data in the location table, and it seems clear in the referenced issue that maintaining compatibility with nodes entered via gmap_location or location was a consideration.
I received a response to my plea for help to Zach. He suggests I upgrade to the latest version of Views. I will give that a try and report back. Hopefully sometime today.
Current version of Views is:
/ $Id: views.module,v 1.125 2006/05/19 02:13:10 merlinofchaos Exp $
I missed that, ha.
Comment #8
pcwick commentedOkay, I installed Views module:
// $Id: views.module,v 1.141 2006/06/25 18:24:56 merlinofchaos Exp $
I ran the update, and still no pins on the View map.
Comment #9
sqlwiz commentedGee, I've just installed the latest views, gmap, location, cck and contemplate, cleared cache and now like you, I've got a map with no markers. ...I hate when that happens...no clue yet as to why.
Comment #10
sqlwiz commentedI found a problem in gmap.moduile in the function theme_views_view_gmap.
$location['lat'] and $location['lat'] are decimal not string.
Here is the line to patch - I'm sure there are alternate ways to fix this, but this works.
@@ -1197 +1197 @@
- if (strlen($location['lat'])>0 && strlen($location['lon']>0)) {
+ if (strlen(sprintf($location['lat']))>0 && strlen(sprintf($location['lon']))>0) {
Comment #11
StuartDH commentedsqlwiz, does this mean you've got views working in the same way as Zacker's screencast, with filtered results on an overall node locations map?
http://www.zacker.org/screencast-drupal-mashup-machine
I've added your patch to the gmap.module, but unfortunately I still can't get views to work.
Comment #12
bahwi commentedNice, thanks. I was just about to spend all morning trying to figure out this problem, and that patch fixed it for my right away.
Comment #13
Zack Rosen commentedThe gmap API changed pretty signifigantly. Here is a full fix.
Comment #14
ansorg commentedI still don't get it :(
I started looking into drupal just 2 days ago. I set up a test site and added nececcary modules, all recent versions. I have nodes with location data and that shows on maps embedded in the node view (story/page)
Now I wanted to try a gmap view.
created a new as described by other people here. But when I open this view I get a page with a small default gmap and above that an php error
what's with that
List and Table types require at least one field.error? I just used the node title.can anybody help?
Comment #15
pcwick commentedThanks for the patch in #13 Zach. There are pins on the node map. Yeah!
In order to make it work I had to enable the the location and location_views modules.
The patch appears to reintegrate gmap and location modules to some extent. I somewhat preferred the direction things were going with changes to the module made in the "Independence from location module" issue, simply because it allowed the node author to select a location by pointing and clicking on a map rather than typing in locative data. On the other hand, typing in locative data is better than no pins on the node map view ;-)
Thanks again.
Comment #16
pcwick commentedansorg, you can change the width of the map by editing one of the macros in the gmap or gmap_location settings pages. I believe the one you need to edit is in the "Location settings for nodes" section of the gmap_settings page, but I don't recall for certain.
I don't know what to tell you about the php error.
As above, you will need to select at least one field in the view. Fields you select will display in the info window that appears when you point at a pin on a map. If you don't select at least one field, you will get an error.
Comment #17
gherikill commentedZack - the patch works perfectly. Now the only problem I am having is that the location part of the content module does not populate the latitude and longitude of a node.
EG
If you want your content to show on a map using views - you have to put the lat and long in manually.
Comment #18
mshaver commentedI'm still having problems with no map showing up for a gmap views of a filtered content type. This worked fine before the above issues surfaced. What specific modules need to be enabled, what versions of the modules do they need to be, and what patches are needed. Any help would be appreciated.
Thanks!
Comment #19
kevinwalsh commentedI think i have a related problem, with only positive-longitude locations showing up on my Gmap Views. I've started a new issue here:
http://drupal.org/node/81731
Kevin
Comment #20
Zack Rosen commentedApply this patch:
http://drupal.org/node/73420#comment-116055
It should resolve that problem. Hopefully we can get webgeer to commit it at some point...
Comment #21
webgeer commentedSorry I missed this in the last round of patch applications. In the future, if you change the status to "patch (code needs review)" or "patch (ready to commit)" I am more likely to notice.
Comment #22
webgeer commentedComment #23
andre75 commentedI applied the patch, but somehow I still have a problem.
Everything used to work fine, but now I cannot get new nodes to show up on the location map anymore.
The old ones are still showing fine.
I applied the patch but it did nothing for me.
Any ideas where this could be coming from?
Comment #24
stephencameron commentedI note you have started a new stream for this... on http://drupal.org/node/83345 - my answer follows that...
Comment #25
(not verified) commented