Attached is a patch to let the path /map/user/ accept a trailing uid. If given, the map is centered around the user's location, provided one is defined. Also, the user's marker is expanded by default.

Comments

tassoman’s picture

Can you add as feature that if isn't passed UID map get centered on current ip geolocation lat-long reference?
For example should work for anonymous users.

That's a reference to new ip geolocation feature of Google Maps APIs 3.0

http://googleajaxsearchapi.blogspot.com/2008/08/where-is-my-current-user...

infojunkie’s picture

StatusFileSize
new1.57 KB

I discovered a bug with the original patch above. Here's the updated version.

Babalu’s picture

is there a option then that i can deactivate that when i want ?

infojunkie’s picture

When you call /map/user you get the unchanged behaviour. When you call /map/user/uid you get the modified behaviour with auto-centering and auto-clicking. It didn't seem to me that this needs a deactivation option, but feel free to update the patch.

Babalu’s picture

the patch is against the 6.x-1.1-rc1 release ?
i have some hunks

tassoman’s picture

I really don't like to hack & patch, is there a way to override things? I maybe could be able to add ip geolocation

infojunkie’s picture

StatusFileSize
new3.7 KB

Attached is a patch that combines centering around a user if the uid is passed to /map/user/, or to center around the client's location if the behavior flag "clientlocation" is specified for the map. This second feature applies to any map, not just user maps.

tassoman’s picture

Hi, I've downloaded 1.1rc1 by drush, then patched correctly, but now I've lost my users markers, and more, map isn't centered neither on anonymous or logged in user with coords.
I've checked the gmaps admin interface's «clientlocation» checkbox, but still not working.

When I saved gmaps settings, and I try to regenerate marker cache I get following error "Cannot copy selected file (/home/tassoman/www/sites/domain.tld/tmp/fileeWTxTC).

I dunno how to debug things. Any hint?

hutch’s picture

@tassoman:
Check permissions on folder tmp and check permissions on the target, possibly files/js

infojunkie’s picture

Status: Needs review » Needs work

The latest patch I submitted is defective. I'll submit a new one soon. Sorry for the inconvenience.

tassoman’s picture

@hutch tmp file is correctly written, but seems unreadable by module.
All my directories are chmodded 775 and files 664, owner is www-data.

I've also tested the path user/map/[uid] but isn't mapped.

Being into Drupal's habits would be good having user's map as url user/[uid]/map and a link to user/[uid]/map/edit that points to user's account edit form with an anchor to location fieldset?

tassoman’s picture

@infojunkie is there any chance to test updates? :q

infojunkie’s picture

StatusFileSize
new3.75 KB

Sorry I forgot about this issue :-) Here's the correct patch.

tassoman’s picture

I've patched against 1.1-rc1 and now clear caching works ... but my user markers still not showing.
How to debug that situation? You know I've a template.php override function I use to fill baloons.

infojunkie’s picture

Do your user markers disappear because of this patch, or even using an unpatched module? I'm using this patch with user markers and they show up fine. I might have cleared the caches and deleted the file js/gmap_markers.js.

tassoman’s picture

In my installation, after apply latest patch to RC1 drush downloaded module, after clicking regenerate, markers cache problem is triggered then markers disappears from usermap. I've also deleted all cache by "drush cc"

This evening I'll try further on a plain scratch localhost installation

tassoman’s picture

OK I've tested a fresh installation, it works good but ... It centers always current user address.
In production installation still unworking :|

tassoman’s picture

@infojunkie how can I try to debug that unwanted behavior? Centering works in a scratch installation, but doesn't in my production environment :(

infojunkie’s picture

In gmap/js/gmap.js, the code

    if (obj.vars.behavior.clientlocation && google.loader.ClientLocation) {
      obj.vars.latitude = google.loader.ClientLocation.latitude;
      obj.vars.longitude = google.loader.ClientLocation.longitude;
    }

invokes Google's ClientLocation object to obtain the client's location. You might want to put an alert or console.log inside the if statement to make sure that the execution reaches this place. If it doesn't, then either the clientlocation behavior is not set, or the Google object is not found. The Google object is instantiated by a Javascript inclusion of http://www.google.com/jsapi?key= followed by your GMap API key.

greenbeans’s picture

subscribing

oliverpolden’s picture

subscribing

tassoman’s picture

Was this patch included into 1.1 version?
My issue refers to RC1.

emarchak’s picture

Subscribing.