I've asked how to make gmap show user location a couple of time, but no one responded. So I'm wondering, has anyone even suceeded at that yet? :/

Comments

Rick R’s picture

Hey, I'm brand new to Drupal, but I've been developing with GMaps recently, these pages walk you through just about anything you'd want to do with GMaps themselves:
http://www.google.com/apis/maps/documentation/ - Read thru for the all basics
http://www.mapki.com/wiki/Knowledge_Base#Tutorials_and_HowTos -
http://www.econym.demon.co.uk/googlemaps/index.htm

Torch’s picture

No, no. There is gmap module for Drupal that allegedly along with locations modules should make it possible for users to enter their locations and that it gets shown on users map. But I followed all instructions, tried loads of stuff myself, but I can't get it to work :/

Torch’s picture

So, no one has officially yet suceeded at doing this?

genemcc’s picture

I haven't had any success with user locations either. If I go to the user's profile and click the map link I get a nice gmap with a marker for their location. But if I try to show a map of all users via the User Locations link I just get a pretty map of North America. Hopefully someone out there has gotten it to work and will add to the thread.

klhowells’s picture

You have to have an account to see the user location map. Click a marker, the username pops up and if they've uploaded a user portrait, that's displayed too. I didn't have to do anything special to make the user locations map work.

www.crestlinesoaring.org

Lines and markers don't print, at least in Firefox/Mandrake 10.0, but you can get a screenshot...

webgeer’s picture

Some help on how to get users locations working using the gmap.module. (This is all based on the recent 4.7/cvs version of the module)

1. Install gmap.module and activate both gmap.module and gmap_location.module
2. Install location.module (optional -- If you don't install it you must manually create the location.mysql table)
3. Make sure that on the admin/settings/location page the "user locations" options is disabled. This is important.
4. Edit access control (/admin/access) to make sure that users can see the map (only users that have map viewing permission can edit their location).
5. Users (or the administrator) can then set their location by editing their account and going to the location map page (or directly by going to /user/#/edit/gmap_user -- where # is the uid). You eidt your location by clicking on the map or directly entering the lat/long. Save the location.
6. Go to the /map/users page and the location you just entered should be on the map.

If you continue to have any problems please go to http://drupal.org/node/33591 and create an issue on the module. I don't read the forums that often, so I can often miss these requests.

The reason that step 3 is required, is that the way that location.module and gmap.module save the location information is not compatible. I am planning on fixing this in the future.

It should also be noted that very shortly, the new version of the gmap_location.module will add text at the bottom of the /map/user page saying in effect "To add you location to this map click here"

James
(webgeer)

[EDIT - Added step 4 about access control - May 21, 2006)

teamrob’s picture

Is there any way this module can work with an image module so a user can upload an image to the gmap infowindow thats links to thier album or blog? I would pay for this feature.

webgeer’s picture

There are definitely ways of doing this general feature, but, out of the box, it probably wont do exactly what you want. Send me an email with more details on how you forsee it working and I will see if it is something I can do.

webchick’s picture

This is obvious from reading the README, but just so they're all in the same place. ;)

Step 3a or 3b: Sign up for a Google Maps API key and enter it into administer >> settings >> gmap.

Thanks a lot for writing these up, James! I was having some problems getting this going. Not sure what I messed up, but by blowing everything away and starting from scratch following these directions it's now working great. :)

ban-1’s picture

Hi,

gmap works like a charm, but i have a weird issue :
all maps via gmap for western europe show a genric map with no details (except for the UK), for example Belgium is completly empty, no cities, nothing. Countries like UK or US do have this info in gmap.
same goes for sattelite maps and hybrid ones.

But if a load the same map via maps.google.com i do get detailed info, also for Belgium.
Is gmap using some older or crippled form of the google maps ? IS there a way to use the new data ?

Ban

webgeer’s picture

The gmap.module uses the Google map API as documented at: http://www.google.com/apis/maps/

GMap module now uses the v2 of the Google Maps API which includes much more detailed maps of Europe. This is the version tagged at 4.7 or cvs. The older version of GMap (and the one online for 4.6) used v1 of the Google Maps API which did not have a very detailed map of Europe.

klhowells’s picture

I've got the Gmap module working on my development site - will be publishing it in a few days.
The User Locations works fine, and I can mix gmap content with bbcode and image assist, as long
as bbcode has the lowest ranking.

One big problem I've had is that the maps only display if I choose 'Static' from the Gmap config
page. This means that the gmap script is included in every page of the website, and maps.google.com
is called on every page load, whether there is a gmap on the page or not. The 'Dynamic' option is supposed
to limit google maps access to only nodes with gmap code in them, but when I select Dynamic, none of the
maps work. I've looked over the module's php code but can't see where Static vs. Dynamic is handled.
Any tips on getting this to work?

A medium-critical problem is that in Firefox, the text in the yellow info bubble when you click on a marker
is broken on every line, and thus flows out the bottom of the bubble. I have a map generated by the
following code:

[gmap |id=map |center=-117.3233413696289, 34.21833196863014 |zoom=5 |width=500 |height=350 |align=None |control=Large |type=Hybrid |markers=number::-117.31372833251953,34.236073463987154:Crestline Launch<br>5,200 MSL, 3,400 vertical<br>Mostly HG, but PG OK in lighter winds. + -117.30205535888672,34.20995668462769:Marshall Peak<br>4,000 MSL, 2,300 vertical<br>HG and PG - all levels. + -117.3233413696289,34.193203619503:LZ - Andy Jackson Airpark<br>1,700 MSL]

I tried putting HTML <p> tags around the note for Crestline Launch, but it didn't help. Any way to fix this?

A small problem is that the link to the gmap macro is always relative, i.e. it looks under the the current 'folder'
of the url - I have pathauto running. Under 'input formats' the 'Create a macro' link is typically something
like 'http://devServer/node/add/forum/gmapmacro', which does not work. If I change the address bar to
'http://devServer/gmapmacro' then the macro comes up.

The last small issue is simply that in the default map size box I had big problems until I added the
units to the desired sizes, e.g. '400px' instead of simply '400'. Looking at the module code made this
need obvious.

Otherwise, in all seriousness, thanks for a very useful module!

webgeer’s picture

Regarding the static vs. dynamic, this is something that I had thought was fixed, but perhaps not. The problem is that it seems that Drupal cache's the content of nodes to save processor time (a good thing). Unfortunately this cache means that the filter is only run the when the node contents change. Therefore if the filter isn't running, it is not possible to know if the node contains a Google Map and insert the proper code into the header of the page.

Theoretically this can be solved by turning off caching for the nodes that run the GMap filter. This is what the "dynamic" is supposed to do. Unfortunately it doesn't seem to work as documented for me. I'm not sure what I've done wrong. This hasn't been a big deal for me lately because for the most part Google Maps has been really quick at filling the request for the script and therefore it is not causing significant slowdowns on page loads.

The flowing out of a info window is a difficult problem. I believe it is related to the Google Maps API and has nothing to do with the gmap.module implementation of it. I haven't seen any solutions for this problem and I have seen it on other sites that don't use Drupal to create the info windows. It does seem to come and go for me. There will be days were everytime I click on a particular marker it flows out of the window and then another day click on the same marker and no problems.

When I have some time I will go through the Google Map Discussion Group again to see if anyone can suggest a way of fixing this.

klhowells’s picture

Thanks for the quick response. None of these isues will keep me from using the module, for the time being. FWIW, I also have site caching turned off.

klhowells’s picture

On my installation, the 'Create a Macro' link fails, since it is specified in the module code as a relative link.
Simply putting a forward slash ('/') into the href would work, making the link relative to the server home. On my development system the installation is one level down from server home whereas it IS at the server root on the published version, so I've altered the function as follows to deal with this.

The URL for the drupal installation on my development system is http://devServ/newSite/ [not on the interweb :) ]


function gmap_filter_tips($delta, $format, $long = false) {
  // KLH 5/2006
  // make gmapmacro link relative to server home
  $preFix="/";
  if($_SERVER['HTTP_HOST']=="devServ") $preFix="/newSite/";
  return t('Insert Google Map macro. <a href="'.$preFix.'gmapmacro" target="_blank" >Create a macro</a>');
  
  // original:
  //return t('Insert Google Map macro. <a href="gmapmacro" target="_blank" >Create a macro</a>');
}

I've also added explanatory text to the gmap macro tool. I'll post a link to it when the site is published (soon).

webgeer’s picture

This is from an old version of the gmap.module. The current version uses the proper method of determining the url link:

  return t('Insert Google Map macro. <a href="%href" target="_blank" >Create a macro</a>', array('%href' => url('gmapmacro')));
tkledzik’s picture

Your directions above worked excellent. I had waded through all of the other documentation- only to have things not work. There's something to be said about short and sweet...

PROBLEM THOUGH.

For the life of me I cannot get the my users map to load centered on the US. I'm always over Spain!
I've got the lat/long but have yet to find the right place to put it!

Thanks for your help in advance

Tad

webgeer’s picture

Goto admin/settings/gmap_location and edit the macro for the default user map to have the center=youlat, lon

James

astra’s picture

Following thses steps my user gmap works well. Thanks for your help!

DaveNotik’s picture

It seems odd that the user enters their location information, but then someone (admin or user) must manually enter the address again to determine its geolocation and add it to the Google Map.

Is there a way to streamline this?

I'm sure someone's got this basic scenario working...?

Thanks for your work!

--D

--
http://dave.notik.com

uknewperson’s picture

Just to say I got it working without using Location Module. It might be of help to other complete newbys ....to add to Step 2 above. .....I had to upload using phpAdmin both the location.mysql file AND the gmap_user.mysql file. To some this might be completely obvious but it wasn't for me. Hope it helps. Thanks all for great module!

genemcc’s picture

I've followed with interest the discussion on this thread. Unfortunately, I don't seem to be able to get this working. From what I've read the location module will geocode address info made by the user and the gmap modules will map it. Well, I don't see it working. I looked at the location table in the database and the LAT and LONG fields are both NULL.

Here is what I thought should be happening so please correct any misunderstandings:

  • Install the location and gmap modules, activate, set access.
  • Users enter address info
  • location geocodes the address info
  • gmap modules take the geocoding and display the locations on a map

What am I missing?

Thanks!

webgeer’s picture

In theory this is the way it should/could work. However, location.module does not geocode many countries and even those countries that it does do, it doesn't seem to do it for users. (I'm not an expert on location.module. I haven't really tried to get the geocoding working so I'm not sure to what degree it works for users) and it does not allow users to enter their own lat/long.

Therefore for the gmap.module/gmap_location.module I created an interface to allow users to enter their own lat/long information using an interactive google map. This is accessed on the user edit page. Currently this is incompatable with the location.module's location entry form.

paddywwoof’s picture

Has anyone had this problem?

user locations added ok and displayed on map/user - links go to relevant user

node locations added (map doesn't work perfectly - keeps going half or threequarters grey) little map appears for each node with the location correctly displayed. However map/node is completley blank of "pins"

www.eldwick.org.uk

obscenic’s picture

Also having trouble with this - with all the modules installed, the API key set up, and the map appearing to work fine, the user info edit page comes up blank. No map to click on, no lat/lon input, just a submit and default button....

suzan24k’s picture

I had this problem too just now and found that when I went to admin/settings/location, and Enabled User locations (Collect user addresses (partial or full) if users wish to submit them for their user accounts) the "edit your location" link got to the account edit location with the lat/long and address fields above the submit.

Hope that was the answer.

Suzan

suzan24k’s picture

Or it might be under admin/settings/gmap_location and you might need to Check On the "Profile map "(
Let users set/edit their location in their profile.)

obscenic’s picture

Neither of these solutions worked - there's also no link on a users account page to allow location editing... any ideas why?

suzan24k’s picture

My users have an Edit tab with an expandable Location link. From the Edit tab, I also have a location map tab which displays the default map with address below map .

I'm no expert but it's starting to sound like your location module is not working. Perhaps you have an incompatible module. I'm running Drupal 4.7.3 and got the module from Drupal 4.7 or CVS modules download. Good luck.

Antorkh’s picture

I had the same Problem, try following:

go to administer->settings->gmap_location
reset everything to default (button on bottom)
Save everything (button on bottom)
And then retry to edit your gmap-location.
It worked for me,

best regards,
Antorkh

globalplayer’s picture

does anybody knows what these logs means:

http:/www.acme.com/javascript/Clusterer2.js not found.

http:/dist.codehaus.org/geoserver/gmaps-geoserver_scripts/wms-gs-1_0_1.js not found.

I've got them and gmap module doesn't show user and nod locations:/

doses anybody knows how to fix it?

thanks for help!

globalplayer’s picture

can problem from the subject be caused because wrong permissions in .htaccess file ??

Christefano-oldaccount’s picture

I know you said you got them, but just to make sure ~ if you're keeping local copies of the scripts they need to be in the a misc directory at the root of your Drupal installation. Depending on how your server is set up, it may look something like /var/www/misc/ or public_html/misc/ or /htdocs/misc (or it may be preceded by a tilde, e.g. ~/public_html/misc/).

The gmap module will look in /misc before fetching the scripts at acme.com or codehaus.org.

Are you sure that the URLs in the errors start with "http:/" and not "http://"? If that's the case, it's a way to narrow down the problem to the gmap module itself.

globalplayer’s picture

>>Are you sure that the URLs in the errors start with "http:/" and not "http://"? If that's the case, it's a >>way to narrow down the problem to the gmap module itself.

yes, I'm sure that the URLs in the errors start with "http:/"

globalplayer’s picture

I add wms-gs-1_0_1.js and Clusterer2.js to misk directory and it works :D

many thanks for help!!!

Christefano-oldaccount’s picture

Always glad to help!

Would you consider writing to webgeer (maintainer of gmap.module) about the errors being written to your logs as "http:/" instead of "http://"?

davidesv’s picture

I set the location where I live, but when I go to display all user map the marker is about 200Km SSW from the right location!

thelionkingraja’s picture

Hello,

I am presenting what i need.

Modules used

CCK
Content profile
Location CCK
Gmap
Gmap Locations
Location
User Locations

I have used this modules and created a content type with only one field of tyoe location CCK and used this in user registration.

I did this in my localhost and viewed the node locations page map/node its working.

The same think is not working in server.

Anybody has the answer ?

Thanks in Advance

Durky Duur’s picture

Has anyone figured out how to show the maps on the user profiles? Seen a few places on how to do this and I actually got the map to show in the edit user mode, but only the link shows and not the actual map when viewing the user profile link.

I have created blocks for this too and to Only show for user/* on the block and still the map does not show in the View profile.