This patch will insert an interactive google map above the latitude, longitude interface that allows one to select the latitude longitude by clicking on the map. This gmap.module, if gmap.module is installed (if not, it does nothing). Note the most recent cvs version of gmap.module is required in order to do this.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | location_10.patch | 3.91 KB | ankur |
| #10 | location.module_10.patch | 1.21 KB | webgeer |
| #9 | location.inc_3.patch | 1.12 KB | webgeer |
| #4 | location.inc_2.patch | 1.16 KB | webgeer |
| location.inc_1.patch | 1.05 KB | webgeer |
Comments
Comment #1
drob commentedWhat is the thinking here? I can see a lot of situations where one would *not* want to have users interactively setting their lat/long - rather it would be tied to the address. I would want the flexibility of making that choice. Any chance that we could get that flexibility in different modules?
Comment #2
webgeer commentedYou would not be required to set your lat,long interactively. How it works, is above the lat,long text fields, if you have the gmap module, you would see a google map. If the lat, long has been set then it will have a marker at the lat long location. If you click on the map, it moves the marker to that location, and enters that value into the lat, long fields (and zooms the map in so that you can enter a more precise location on the zoomed in map). The ability for the user to enter the lat, long is not something I added, it is already in the location.module. I just made it easy to find out the right lat, long.
Most of the world is not covered by location.module geocoding, and most people don't know the lat, long of a specific location. This provides a very easy to use method of entering the lat and long of a location. Having the lat, long entered can be extremely useful for a number of different applications.
It would be very easy to make it so that the use of this can be a setting. I will change this patch so that this functionality can be disabled.
Comment #3
Zack Rosen commentedManually setting latitude and longitude via the location module needs to be able to be disabled. Many (or most) people using this module do not want their users to see these options.
Weebgeer, will you be rolling a patch to fix this problem as well? Or should I work on it?
Comment #4
webgeer commentedThis is a little improvement. To answer concern, this functionality can now be turned off with a gmap.module setting. This could easily be changed to a location.module setting if that is a better approach.
Comment #5
Zack Rosen commentedExcellent. I think it would make more sense to be able to globally disable long/lat forms in the location module. Want to roll a patch?
Comment #6
webgeer commentedJust one comment on this issue. This patch/feature request has nothing to do with the ability of users to enter longitude and latitude information. This functionality was already included in the location.module.
This just provides an easy interactive interface to set the latitude and longitude using a google map. It just provides some javascript that draws a map and fills the existing latitute/longitude fields.
Personally I like having the ability to set the latitude and longitude. Having the latitude and longitude is extremely useful for pruposes of mapping, or finding the straight line distance or proximity. Relying on geocoding is very problematic. (Most of the world does not have geocoding for it available. Personally I haven't been able to get it to work for the US for me -- Although I haven't spent that much time on it as I'm not in the US and therefore it isn't that useful for me.)
Comment #7
Zack Rosen commentedOk. I will roll a patch then that will allow users to disable long/lat globally inside location module.
Comment #8
Zack Rosen commentedRolled a patch:
http://drupal.org/node/59081
Comment #9
webgeer commentedSo here is a revised patch for location.inc using location.module settings.
The patch for location.module will be uploaded attached to a separate comment.
One other note I should probably make, is that using the interactive map will still allow manually entering the lat/long if you have it. When you manually enter a lat/long it will move/add a marker for the manually entered location.
Comment #10
webgeer commentedOK perhaps I misunderstood what Zacker said. I made it a location.module setting to disable the interactive gmap. Personally, it doesn't matter to me whether this is a gmap setting, a location setting or it just always uses it for lat/long entries if you have both location and gmap modules installed.
Comment #11
Zack Rosen commentedMy .02: Make this a location module setting that only shows up if the gmaps module is installed. It would be nice if it were also aware of the new setting I rolled a patch for that allows admins to disable/enable the long/lat forms.
Comment #12
webgeer commentedI thought of making it only show up if gmap.module is installed, but I think that letting people know about the functionality as being available from gmap is a good idea. It doesn't really cause any problems by having that setting there. I think it is pretty clear that you need to install gmap to use it.
I also think that it eliminates the problem of people installing location.module going through the settings of that, and then aftwards installing gmap.module and going through the settings of that, and therefore not seeing this setting.
Comment #13
Zack Rosen commentedThis should be handled the same way the CiviCRM specific options are, only show this option if the GMap module is avaliable. You can do some fancy stuff though like auto-enabling it if the Gmap module is installed at a later time. If you advertise this functionality in the GMap module I don't think there will be any usability concerns.
Comment #14
ankur commentedCommitted to HEAD.
Thank you, webgeer, for your patches. I messed around with them a little before committing, however. The form of the final patch is that of the attachment here.
-Ankur
Comment #15
(not verified) commentedComment #16
moshe weitzman commentedI just installed both of these modules on http://groupsbeta.groups.org. I am seeing a Location fieldset on the main edit page and then a google map on a new location map page. Further, when submitting a map it wipes out address info given in Location fieldset. Am I missing something? I'd like to get these working wel and then i'll add some organic groups integration and we'll be flying on groups.drupal.org.
thanks.
Comment #17
moshe weitzman commentedI should add that the straightforward fix is Gmap to show up alongside the Location fieldset so they submit in one form, thus avoiding the data loss issue
Comment #18
moshe weitzman commentedAlso, it looks to me that the map info is being discarded when submitting a node because on the subsequent node view I see only 'United States' as Location. Please try adding an event at http://groupsbeta.drupal.org
Comment #19
webgeer commentedThe user location integration problem is a known problem and is a gmap problem not a location.module problem. The workaround is to not use the location.module for users and set user locations with the gmap.module. (This can be achieved by disabling user locations in the /admin/settings/location page.)
It should be noted that the patch added as part of this feature request not the source of the problem and is totatally unrelated to it. When this feature request: http://drupal.org/node/58795 is done then the setting of location of users in the gmap module can be deleted and all of the incompatibilities will be addressed.
I don't think the "straightforward fix" you suggested would work. However, I haven't tried it. If you try it and it works please submit it as a patch to the gmap.module.
Regarding your last comments Moshe, the location information that is shown below the node does not include the lat/long ever. The map information for nodes most definitely is not discarded. If you edit the node again the information will be there (the map will have zoomed back out, but the marker will be at the location and if you zoom in you will see it is exactly where it was set)
It is important to understand that how this actually works is the lat/long forms are those that have always been in location.module. This just adds an interactive map and some other javascript that will update the lat/long form elements when you work on the map. The underlying form is the same form that location.module has always used for lat/long entry, and therefore is treated exactly the same from the perspective of validating and saving the information.
Comment #20
moshe weitzman commentedthanks for the info, james. very interesting.
nice that the map info is not discarded. i got that impression because i saw no map on the view for the node, and i did see other location info. so lets add the map when viewing a node if gmap is enabled and we have sufficient info to build a map.
thanks for your great modules.
Comment #21
webgeer commentedPersonally I'm a little reluctant to be adding too much gmap specific stuff to location.module. This integration only adds a few lines of code and is quite transparent to the operation of the location.module.
Adding a map to the location block below the map adds quite a bit more code and has a lot more issues that need to be addressed. I have thought of a couple of other possible ways of showing the location for a node. These will probably be integrated into a new module that will be packaged with the gmap.module called gmap_location.module. The existing plotting users on a map will be moved to this new module and new function for plotting the nodes on a map will be provided.
I have been also thinking about adding a block that would show the location of the current node from the location module. (This is quite trivial to do and I know this hase been done before), another possibility would be to add the map linking to have a "googlemap on my site" which would then go to a page with a google map showing a marker for the current node's location.
Comment #22
moshe weitzman commentedI don't think any gmap code has to be added to location module. here is some pseudocode
function gmap_nodeapi() {
if ($op == 'view') {
if (node has location data in it) {
$node->body .= gmap_render_map($node);
}
}
}
Comment #23
catchhttp://drupal.org/node/125001 - this issue's older, but that one has a patch.
Comment #24
onzenet commentedNode Locations works perfectly, too perfectly for me ... I need Node location for a content (working right!) but i can't get rid of a 'Location' ('Emplacement' (fr) ) on user registration (except by disabling the 'Node Locations' module :( . Please, any tip or suggestion is warmly welcome ...
Comment #25
onzenet commentedDrupal v6.13
Location Nodes v6.x-3.1-rc1
Node Locations works perfectly, too perfectly for me ... I need Node location for a content (working right!) but i can't get rid of a 'Location form' ('Emplacement' in french , with address , country ...etc.. fields) on user registration (except by disabling the 'Node Locations' module :( . Please, any tip or suggestion is warmly welcome ...