This patch fixes two usability bugs with the location picker interface:
* it is very unintuitive to remove a marker from a map / form
* it is easy to 'lose' the placed marker in a map by double clicking on the map

I changed locpick.js so that a double click is required to set a location. A single click on the marker is required to delete a location.

Since two single clicks can not reliably be differentiated from a double click, a check is in place with a timeout to check if the user clicked once, in which case they are reminded with an alertbox (up to two times in the DOM lifetime) that they need to double click to place a marker on the map.

I also hid the lat-lon textfields from the user's view when js is enabled. This requires a new css file attached gmap_location.css.

This patch includes diff lines in file gmap.module from the patch at issue #236029 (load markers in chunks, js-compressor compatibility). I'll reroll it once #236029 is committed. The additional lines in file gmap.module that THIS patch requires are:

+        // Client-side UI strings need to be translatable too.
+        drupal_add_js(array('locpickSingleClickMessage' => t('Double click the map to set the location.  Single click the marker to delete.')), 'setting');

The patch also includes changes to gmap_location.module to ensure that only user locations with lat-lon data are SELECTed in hook_user(). I also tidied up and optimized some code in that function for readability and maintainability.

CommentFileSizeAuthor
#2 238471-2.patch510 bytesBevan
#1 238471.patch14.93 KBBevan

Comments

Bevan’s picture

StatusFileSize
new14.93 KB
Bevan’s picture

StatusFileSize
new510 bytes

I forgot to upload the new css file, but it is better as part of the existing CSS file, gmap.css

najibx’s picture

Hello, it looks like this patches never got committed in the 5.x-1.x-dev 2008-Aug-22 ? Is this the reason, I can NOT set a marker nor i see instruction "Double click the map to set the location. Single click the marker to delete".

I used to be able to use this in older version :-)

podarok’s picture

Status: Needs review » Closed (won't fix)

release unsupported
feel free to open issue against latest 7.x dev