I really would like to use this module for a simple display of the users on my site. I tried installing it, per the instructions, but I have a feeling that the instructions refer to older versions (it just doesn't fit).
I tried installing it as per instructions (load gmap directory into modules directory). That did not even show gmap, so I decided that maybe you meant loades gmap elements into modules directory. So here is my installation:
I installed CVS on a 4.7 drupal site. I played around and finally got the map size, position, etc. macros to update:
http://gates-chili-high.org/map/users
I have the following installed in my modules directory:
gmap.module
gmap_location.module
gmap.css
gmap.js
gmapmacro.js
And a marker directory labeled 'markers', with a number of marker pngs.
My access control panel allows:
administrator access to gmap module to create a macro
AND
access to show node map, show user map, and user locations to everyone (all three are user types are checked).
My modules section has gmap and gmap_location both checked.
My settings -> gmap:
My google API number
map method is set to 'static'
enable clusterer.js not checked (tried it checked, but no change).
All the map coordinates are set and working fine (as I showed above, map can be displayed)
default location map:
[gmap |id=map |center=41.902277040963696, -95.9765625 |zoom=3 |width=550 |height=500 |control=Small |type=Map]
My gmap_location settings are:
default user map:
[gmap |id=usermap |center=41.50857729743935, -97.03125 |zoom=3 |width=550px |height=550px |control=Small |type=Map]
marker for users - markers (as stated above, this is a directory in the modules directory)
default node map:
[gmap |id=nodemap |center=41.50857729743935, -97.03125 |zoom=3 |width=550px |height=550px |control=Small |type=Map]
I have setup the 'location' table in my drupal database.
But, I cannot figure out how to display markers, setup even one marker, setup markers for my users, or let them setup markers, or (best case scenario) have the registration process setup markers.
Can someone just walk me through the basics of what I have to do? I am really lost here. Thanks and take Care, Sharon
Comments
Comment #1
webgeer commentedThe only thing I thing you are missing is that no users have lat/long set for them.
Users should be able to set their location by going to the /user page then clicking on the 'edit' tab and then clicking on the "location map" page.
You can access this page directly with /user/#/edit/gmap_user (where # is the uid of the user being edited).
I will see if I can add a way to try and make it more visible to the users.
If you have already tried this, or you try it and it still doesn't work. Please check the contents of the location table directly (using phpmyadmin, or some other tool) and see if there are any entries in that table with lat/long data.
It should work with the gmap directory as a subdirectory of modules (That is the way it is setup on all of the sites I have working). If by moving it out of the subdirectory, you fixed a problem, this probably has more to do with cacheing than with the location of the modules. I would recommend moving it back into a subdirectory, but this might cause some caching problems. You should be able to solve this if you uncheck all of the modules and then recheck them.
I hope this helps you,
James
Comment #2
lanesharon commentedI resolved almost everything 5 minutes after I posted. Isn't that always the way? I am still trying to wade through the marker and an easier way for people to get 'marked'. It seems to be going to the red with black dot default marker (and I don't even have that installed anywhere!).
When I get everything working, I will post here just to give a 'walk through' for those who are still having difficulty.
I doubt if my users would ever look up lattitude and longitude, so I (most likely) will be doing this myself. If I had a DB (or connection to a DB), is there a relatively easy way to hook into address (which I get from each user anyway) vs. lat + long?
Thank you for your reply.
Comment #3
lanesharon commentedSorry, forgot to mention one thing. Opera (browser) does not display the user balloon properly, if there is an avatar. The balloon stops halfway through the picture, regardless of the font size setting.
Comment #4
webgeer commentedGoogle Maps uses the red marker with the black dot when you don't set any specific marker. GMap uses the default marker if you don't specify, or if you specify a marker that it can't find. It currently looks for the directory: /modules/gmap/markers for the markers. I will change that with the next upgrade so that it looks in a the 'module' subdirectory of wherever the gmap.module is installed.
As for looking up lat/long, you shouldn't need to look it up, it can be done with the interactive map to locate users.
The location.module is supposed to be able to do geolocating from the zip code. However, I'm not sure if it works for users. The user entry of location.module is not compatible with the gmap.module's user entry.
Thanks for the note about Opera. I haven't used Opera in quite a while. However, the drawing of the pop-up windows is done entirely by Google. The gmap.module just passes the html straight to Google. Even in IE and Firefox, the pop-ups are sometimes screwed up even for very simple html being sent to Google. I'm trying something that might help a bit.
Comment #5
lanesharon commentedWhen I look at gmap.js, there is a list of map icons in there. I tried changing this to no avail. I even removed the icon entry for the 'standard' icons and it still showed the google icon. I thought that was rather weird, since there does not seem to be any other reference to a google.com page and I do not have any of the default icons loaded. So, can I assume that at least the icon code of gmap.js is not being used anywhere?
So, are you saying that I do not have to activate gmap_location module?
Or I do not have to have to install the location table if I am just going to have a user map? (I would be surprised if that were true, since my long and lat values are being stored there when someone marks the user map.)
I added a test user and used the map to locate a marker. And then I changed the position of that marker. That works great because I am only offered the 'Submit' button.
Now, here is the bad thing. As the administrator of the site, I added a marker, no problem. But when I went to edit the position of the marker, I am given a 'Submit' button and a 'Delete' button. I, being not so bright, tested with my own account first and, well I am sure you can guess what I did. I clicked the 'Delete' button offered on the location map edit screen and that deleted my entire account. To me, it seemed logical, that if I wanted to remove my entry from the map, I sure press the 'Delete' button!
Since I am the owner of this installation, it took a lot of time and work with phpmyadmin to recover all the info and entries for my own account (my admin user # was changed to 0 - the anonymous account, in all the table entries). Fun, fun, fun. I have no idea why the 'Delete' button is only offered on the Administrator's location map screen, but this is dangerous! A lot of people would not know how to go back and rebuild.
I am off to bed. I hope that you take the time to reply and address my further questions and issues. Thanks for replying, thus far.
I would like to learn how to use custom markers. Is there a way to allow the user to choose from a selection of several different markers?
Take Care, Sharon
Comment #6
webgeer commentedThe markers icon .pngs have to be in the directory: 'modules/gmap/markers' for the script to find them. If it doesn't find the marker there it doesn't give google any marker information and if google isn't given any marker information it uses the default marker. (The gmap.js code is not setting the default marker, it is setting the additional marker information, that custom markers need, by changing that you would make it so that custom markers may not work right, but default markers will still work fine.)
You do have to activate gmap_location module. You do not need location.module if all you want to do is set user locations interactively with the gmap.
Given that it sounds like you have messed around with the source code some I suggest that you uncheck the gmap and gmap_location modules on the /admin/modules page remove the existing gmap files in the 'modules' directory. (Make sure you get them all. It is important that none are left there.)
Then download a fresh 4.7 or cvs version of the gmap module. Copy or gunzip the files so that they are in the modules/gmap directory. make sure the markers icons are in the subdirectory 'modules/gmap/markers'.
Now go to /admin/modules and activate gmap and gmap_location modules.
This should get you back to the default setup. Now if you go to /admin/settings/gmap_location and set the "marker for user" to be one of the markers in the modules/gmap/markers directory (for test purposes try 'purple' -- you don't include the .png). When you go to /map/users the new marker you selected marker should be used (purple marker should be there). Note that the choosen marker is not used on the user/#/edit/gmap_user page.
There is no way to allow users to set their own marker icon. It is not a feature I plan on providing, but if someone really wanted it it could be done (would involve adding a new table to store this information). More interesting to me would be to set the icon based on role, or perhaps some user taxonomy, but I don't plan on doing this in the short term.
As for your comments about the "delete" button. I am really sorry to hear what happened. However, that has nothing to do with the gmap.module. Contrary to what you state, that button is not just on the user/#/edit/gmap_user page it is on every 'user/#/edit' page and subpage. This is put there by the drupal user edit system, not by the gmap module. Unfortunately what you did is not that uncommon of a mistake to be made by new admins. I think if you search for "accidently deleted admin account" on the drupal.org site you would come up with quite a few hits.
For the record if you click on the marker itself, the map location is cleared.
Comment #7
lanesharon commentedI always keep a backup of any module I modify, so that I can go back to the original. And I always note any of my modifications, so they can be easily removed. So, there was no reason to redownload.
Once I had the instructions on how to 'set' the marker, I was able to fix it in seconds. Thanks for taking the time to help me. Two problems you may want to look at:
1. You said "For the record if you click on the marker itself, the map location is cleared." This didn't work. If I go to the edit and click on the marker, it does remove the marker, but I immediately get these errors:
Latitude must be between -90 and 90
Longitude must be between -180 and 180
And does not allow me to remove the marker. It initially shows it as gone, but when I go back into the user's accont, it is still there. I can use phpmyadmin to remove, for now, but you might want to look into this. I will keep an eye on CVS.
2. I got my custom marker to show when I display the map, but when I am in the edit mode for a user, it still shows the Google default marker.
BTW - thanks for a great module! I appreciate your work and your help.
Comment #8
webgeer commentedNo problem. This kind of thing helps me understand how to make the module better.
Resonding to the points:
1. I never noticed that. I will see if I can fix it.
2. That is (sort-of) on purpose. The location setting code is very generalized code and could be used in a number of different locations and therefore it is much easier to always use the default icon.
Comment #9
webgeer commentedAs I think the main support is now solved, I will close this request.
Comment #10
webgeer commentedI just wanted to note that I fixed it so that you can delete your current location by clicking on the marker.
Comment #11
lanesharon commentedYup, I noticed that today and got it all working. Thanks. The default marker situation has become interesting. If I am logged in, I get my custom marker. If I am not logged in, I get Google's default.
Just an aside, your website paypal link is not working.
Comment #12
webgeer commentedI think this might have to do with file permissions. Do you have the module 'filemanager' activated?
It seems that if I go to: http://gates-chili-high.org/modules/gmap/markers/pink.png, I am blocked from getting a copy of that file. Whereas on my site: http://webgeer.com/modules/gmap/markers/pink.png I can see it (It needs to be accessible so that it can be found by both the filesystem and the remote computer). This is probably why you are having the problem.
Strange that Paypal link isn't working for you. It works fine for me.
Comment #13
lanesharon commentedSorry, I do not have any png loaded other than:
http://gates-chili-high.org/modules/gmap/markers/class.png
Comment #14
webgeer commentedThanks for the info. This was actually a bug. Should be fixed with the cvs version now.
Comment #15
webgeer commentedComment #16
(not verified) commented