While I like the gmap module very much, location.module is too country-specific to be of real use for me.
Attached are two patches, for gmap_location.module and gmap.module, that make the gmap module independent of the location module, while remaining compatible with the location.module database.
- in admin/settings/content-types, you can enable users to set a location using a google-map in the node submit form
- in admin/settings/gmap_location, you can enable/disable a profile category where users can enter their location
- users_page moved to gmap_locations.module
The patch also includes some minor code cleanup (indentation etc).
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | gmap_location_independence.patch | 18.18 KB | ahoeben |
| gmap_loc_location_independence.patch | 21.36 KB | ahoeben |
Comments
Comment #1
ahoeben commentedpatch for gmap.module (above is for gmap_location.module)
Comment #2
webgeer commentedWow!
I'm impressed, this is really cool. I've been thinking about doing something sort of like this (I was considering making a location_light.module that would use a similar approach) for a while (like you I am outside of US and found 90% of the location.module stuff to be excessive.)
There are a few little things I want to fix before I commit this to cvs:
- There seems to be some compatibility problems with this version of gmap.module and location.module -- The markers are not being drawn on map/node if the node type is not enabled for setting a gmap location, it should be enabled if the location can be set in location.module. What I am thinking I may also do is disable the ability to use the gmap location functionality for nodes if location.module is enabled.
- For some reason the admin/settings/content type has the gmap setting show up below the buttons.
Comment #3
webgeer commentedSo I have now committed this to cvs with a couple of bug fixes/implementation differences done. Should probably still be considered "in development, but it works for me".
What I fixed:
- fixed it so that gmap location fields only shows up where desired. (Use hook_form rather than hook_form_alter)
- fixed it so that if the location.module was used for a node rather than the gmap_location it will show on map/node
- moved lat/long fields to below the map
Again, thanks. This is cool. Does anyone want to do me a favour and update README.txt???
Comment #4
webgeer commentedOf course that hook_form didn't work. Not sure where my mind was. Will put it back to the way it was and then try to figure out why it shows on every node type....
Comment #5
ahoeben commented> For some reason the admin/settings/content type has the gmap setting show up below the buttons
Same as with this issue. The choice is to have it all the way on top, or below the buttons. Don't like it all the way on the top, so opted for below the buttons. I'ld vote to keep it like this, until there's a fix in core.
> fixed it so that gmap location fields only shows up where desired.
Err... oops! I'm looking into that.
Comment #6
webgeer commentedI figured it out. Should be updated in cvs in just a few minutes. (Just polishing up some geocoding stuff).
I moved it to be at the top. I didn't like it below the buttons. I guess I can move it back down...
Comment #7
ahoeben commentedDOH!
In gmap_location_form_alter (~line 560):
should ofcourse be:
(not rolling a new patch since I currently have no time to see what you have already checked in)
Comment #8
webgeer commentedI had found that.
It is now in cvs. Along with Googlemaps Geocoding!
Comment #9
Nick Brown commentedDoes this make gmap_location independant for entering node locations awell?
Comment #10
webgeer commentedYes that is the whole idea.
Comment #11
Nick Brown commentedso, if I disable the location module, but have the gmap and gmap_location module enabled, there is no map on the edit page of nodes to enter their location. Am I doing something wrong? Do I need to configure something?
(with location module enabled I get the location section with a map in it.)
Comment #12
ahoeben commentedOn admin/settings/content-types press configure for the content-type you want to add the map to. There's a 'Google maps' section on the node type configuration page.
Comment #13
Nick Brown commentedI'm afraid I don't see this. I only have a "submission form" and "workflow" section on the node type configuration pages.
I have gmap from with commit #34688 (23rd June). Do I need commit #35236 from today to make this work?
Comment #14
ahoeben commentedAt the risk of asking a dumb question... Did you enable both gmap.module and gmap_location.module?
And we're talking Drupal 4.7.2? I have not tested HEAD recently. I can see no other reason for _form_alter not working.
Comment #15
Nick Brown commentedI'm using drupal 4.7.2, both gmap and gmap_location module are enabled, location module disabled.
admin/settings/content-types/blog admin/settings/content-types/image etc do not have a gmap section, only "submission form" and "workflow". I'm using default theme. map/node displays fine. no errors report in drupal logs.
Comment #16
Nick Brown commentedI updated to gmap cvs and everything seems to work fine.
Comment #17
(not verified) commentedComment #18
dgrant commentedIs this in the 4.7.0 version of the gmap module?
Comment #19
dgrant commentedsorry, I should have also added: if this is only in CVS, does the gmap module in CVS work with 4.7.0? or just 5.0*?
Comment #20
ahoeben commentedWebgeer says he submitted it to cvs on june 16th. The latest release for 4.7 is from october 25th (yesterday). So yes, this has long since been available in the non-cvs version.
Comment #21
mrgoltra commentedsubsribing
Comment #22
bdragon commentedWait, what?
You're subscribing to an issue that's been closed for two years?
Comment #23
mrgoltra commentedSorry I am a bit confused. Version says 6.x-1.x-dev and also the date. just for reading references. I hope you don't mind