Closed (fixed)
Project:
GMap Module
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
18 Feb 2007 at 21:49 UTC
Updated:
10 Jul 2008 at 17:44 UTC
This is the master bug for issues between GMap 5 and Location.
I recently committed some changes to GMap that should fix problems people are having with the (previously unfinished) gmap_set_location function. Setting latitude and longitude with a google map should work properly in the next snapshot of the DRUPAL-5 branch.
http://drupal.org/cvs?commit=56982
http://drupal.org/cvs?commit=56983
There are still some issues with location and GMap.
The primary issue I am concerned with at the moment is gmap_location.module. It is not checked through yet, and has an unfixed issue regarding saving locations.
Comments
Comment #1
bdragon commentedMarked the following issues as duplicates:
http://drupal.org/node/118993
http://drupal.org/node/119706
Comment #2
benma commentedGreat! The location chooser works again!
There's a minor problem, though: upon setting the location, the map automatically zooms in. However, it does not center on the marker position, so that sometimes the marker disappears from the map. However, this does not affect the functionality.
Thanks!
Ben.
Comment #3
bdragon commentedI just made a slight change in the click code. I moved the map panning to occur after zooming. That might help with the "marker being off center" problem.
Comment #4
michaelfavia commentedI dont know id youd like it reported here or in its own issue but GMAP is triggering on the user locations page:
Comment #5
bdragon commentedI just removed the obsolete copy of the location table from gmap_location.install.
http://drupal.org/node/122928
Comment #6
benma commentedJust to give an update on the problems I still experience with the latest version:
- the gmap block does not get shown (mentioned somewhere else as well)
- gmap views don't show any markers (the /map/node gmap however works fine)
Looks like those are the only two things keeping me from updating!
Thanks for working on this, and if you would like me to test specific things, let me know!
Cheers,
Ben.
Comment #7
owen barton commentedI walked through the issue with saving locations, and understand the problem (both location and gmap are, on node creation, trying to do an insert - and hence the second one fails).
However I was not able to fix this because I don't really understand what the intended function is. Both gmap and location seem to have geocoding functionality. Why is this? Where is the right place for the geocoding functionality to live?
Once both the gmap and location developers have clarified/agreed on this then I think we can work on a solution. One thing I would suggest is for gmap to use a location save API (which we will need to create), rather than directly accessing the database.
Comment #8
bdragon commentedGmap has geocoding because it's very simple to do client side. (It's basically built in to the google maps api)
Location has geocoding because it's a good feature to have available.
For persistantly storing locations, I think location's geocoder is the way to go, as I think the GClientGeocoder technically isn't supposed to be used for that sort of thing.
Comment #9
owen barton commentedIn that case I would like to propose that we remove the gmap_location hook_nodeapi() and hook_user(). Location module already does the geocoding, as you say - and has a nice infrastructure to allow multiple geocoding providers.
This would leave gmap_location with the functionality of choosing markers for user roles and node types, the location block, and the global user/node maps.
These would be switched to use $object->locations[$index]['latitude'] (or location or lat as appropriate) instead of $object->gmap_location_latitude to find a node or users lat and long.
Does this sound reasonable? I don't think this would cause any loss in functionality (unless I am missing something) and would prevent the duplication errors currently occurring in gmap_location, as well as simplify the code!
Comment #10
benma commentedI realized that the problem with the gmap views (see #6) is that I did not select the latitude & longitude fields. In the 4.7 version, this was no problem, and I would prefer if this was not required for the gmap view to work. But maybe this is rather a problem of the views module?
Ben.
Comment #11
Nemo@groups.drupal.org commentedI also agree with Ben. I would like to not set lat, long in views' fields. When you set lat, long in views' fields, there's no way to hide them on popup windows. I like the 4.7 version in which it doesn't require.
Comment #12
alanburke commentedAs a workaround, You can hide the lat and long co-ords with CSS
I'll post the simple CSS I use to do this if anyone is interested
[I don't have access to it on this machine]
Comment #13
benma commentedWould be great if you could post the code!
Thanks!
Ben.
Comment #14
bdragon commentedI did it like that to significantly increase speed (it doesn't node_load all the matches anymore.)
How about this as a compromise:
I can make it ignore the first instance of latitude and longitude when making the info box. So you can just add them a second time if you need them.
Sound like a plan?
Comment #15
benma commentedThat would work for me - but I guess it should be well-documented, to avoid confusion...
For me it would be ok to use css to hide it - maybe that's more usable?
Ben.
Comment #16
owen barton commentedThe views thing seems pretty unrelated to this issue ;)
I would be really interested in feedback on my proposal in #9. Unless anyone can point out a reason for this code to exist it seems best to remove it (since it is causing PHP warnings).
Comment #17
alanburke commentedSimple css as requested in #13
Let us know how it goes.
Alan
Comment #18
bdragon commented@#16:
Agreed re #9.
I haven't figured out how to get location to ask users for coordinates yet on the user page though. I'm pretty sure nodes work OK without the hook though.
Comment #19
benma commented@#17: Thanks, Alan, it works great! And sorry for getting off topic...
Ben.
Comment #20
bdragon commentedTurns out location does NOT have the ability to specify lat/lon for users.
Please help review http://drupal.org/node/125001 so we can finally get rid of the code that writes directly to the location table.
Thanks.
--Brandon
Comment #21
owen barton commentedI guess I had missed the lack of this feature before since we normally use CiviCRM (which works with location) for storing user locations.
I'll take a look!
Comment #22
bdragon commentedI just applied a temporary fix for the user location bug.
http://drupal.org/node/118817
Please help reviewing the patch on the location side to fix user locations once and for all:
http://drupal.org/node/125001
Comment #23
robin monks commentedIRT: http://drupal.org/node/118993
I was able to solve this on 4.7.x by adding:
$keep = 1;Just before:
In location.module.
Issue was location would check to see if the location information was empty, and delete the record if it was, but it didn't check if it gmap had location information. This patch means location will never delete records, but will leave empty records, which seems fine in this case. (IMHO)
Not sure if this will help your 5.x plight. This should be fixed in a sane way, and applied to 5.x and backported to 4.7.x.
Robin
Comment #24
discursives commentedThanks for all the work, folks. Looking forward to geocoding coming from somehwere. Right now, map selection works, but a lookup from the location fields is something to look forward to.
Comment #25
discursives commentedI've been looking around at a lot of issues. Is geocoding supposed to work, now? Somehow? Maybe yes, maybe no?
Comment #26
robin monks commentedI'm also having Geocoding issues with Location and GMap in 5.x, it's a bit complex so I'm going to try and explain them as much as possible but you'll still probably need to read it all twice:
1- GMap & gmap_location has the geocoding functionality
2- The address field and nodeAPI function (among others, but I think these are the more important) are commented out in gmap_location.
3- Location doesn't have the proper field for doing the address->long/lat conversion for nodes
4- gmap_location depends on location, location depends on gmap for it's functions
I end up with the big requirement loop, but yet I still can't get a node with a address field that a user can use to geocode their address/postal code into a long/lat. I contemplated making location not require gmap, but since the geocoding functions and the views display type are there, it didn't make sense for my limited time. I also contemplated uncommented that address field, have both sets of address fields display, using css to hide locations, and have location handle the submitted data (what I had done 4.7), but a non-intensive walk though the codebase made this looks unlikely.
Some information on how to get this working, or if some work needs to be done a good clear reference on where to do it would be invaluable for me at this point.
Robin
Comment #27
eddie123123 commentedwarning: array_intersect() happens to me when I delete a user from my drupal site.
Comment #28
raintonr commentedI just took the latest GMap snapshot (2007-Oct-10) and location setting is not working here. This is with the latest location.module (2007-Oct-08).
When one tries to enter location information on a node, the map appears but is not centered correctly (see http://drupal.org/node/144290#comment-322422).
When one clicks on the map to set location a marker appears and the maps zooms in. The marker is being placed in the wrong location though (not where the click was). From what I can tell it is always too far North. The distance out seems to be variable - the higher the zoom (ie, only 1Km top to bottom on the map) the closer things are. With zoom set so a whole country on display the marker can appear many more miles North.
This is odd, as when one enters lat/long manually the marker is placed in the correct location.
Comment #29
raintonr commentedI must apologize for the last comment... it would see the problem (points recorded too far north) is only happening on one PC that has the Beta version of Firefox 3 (Mozilla/5.0 Gecko/2007091216 GranParadiso/3.0a8) installed.
Slightly odd that the browser would cause the issue, but confirmed last night that on different machine with FF2 things are fine.
Comment #30
eMPee584 commentedquoting #26 "I end up with the big requirement loop, but yet I still can't get a node with a address field that a user can use to geocode their address/postal code into a long/lat."
That's exactly my issue: I simply want user profiles to have an address field and a map. I hope this will be possible some distant day (with recent advances of science, technology and stuff, you know ;)
Comment #31
bdragon commentedI am working on reintegrating all the changes I have locally *except* the user location removal right now.
Comment #32
summit commentedSubscribing.
Very interesting!
greetings,
Martijn
Comment #33
mercylam commentedWhere can I find the most updated instructions for installing the GMap module? The ones downloaded with the module states it's outdated. Thanks for the help.
Comment #34
raymondllee commentedSubscribe
Comment #35
mercylam commentedSorry, Subscribe where?
Comment #36
tanoshimi commentedSubscribing
Comment #37
bdragon commentedWell, since I'm now the location maintainer as well, I can coordinate with myself to make sure they don't break each other ;)
Comment #38
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.