Issue #338740: Display locations as polygons on gmap views originally had changes to allow locations to be displayed as polygons on a gmap view as well as allowing multiple locations to be selected on a single gmap for node locations (instead of having a different map per location).

That issue has now been split into two. That issue takes care of displaying locations as polygons and this one is for allowing multiple locations on a single map.

For this patch to work you also need to apply a patch to the location module, which can be found here - #338745: Multiple locations on a single map.

This patch is for gmap 5.x-1.1-rc1.

In the next few days I will look at porting these patches to drupal 6 as I get time.

Comments

aren cambre’s picture

Status: Patch (to be ported) » Needs work

Subscribe. This is a GREAT improvement.

Probably should be "needs work" since patch goes to 6.x first then backported? (Am I splitting hairs?)

agileware’s picture

No, that's fine.

yesct’s picture

tagging

aren cambre’s picture

How is the 6.x patch looking?

agileware’s picture

Going to start working on a patch for this for drupal 6 now.

agileware’s picture

Assigned: Unassigned » agileware
Status: Needs work » Needs review
StatusFileSize
new18.07 KB

Here it is.

This patch is for 6.x-1.x-dev (2009-Apr-18).
The patch does not apply to 6.x-1.1-rc1 but if someone really needs it to another patch can be done for it. Should be a minor change.

Please test this and let me know if you come across any issues.

*And remember, you need the patch for location here - #338745: Multiple locations on a single map

aren cambre’s picture

Status: Needs review » Needs work

For what it's worth, ran this on the June 9 1.x-dev (don't know where to find he Apr 18 dev):

$ patch gmap.module gmap_single_map_6x-1x.patch
patching file gmap.module
The next patch would delete the file locpick.js,
which does not exist! Assume -R? [n] y
patching file locpick.js
patching file locpick_multi_map.js
patching file locpick_single_map.js

I guess something changed?

agileware’s picture

I have run the patch in #6 successfully for the 2009-Jun-09 version of gmap 6.x-1.x-dev (also against HEAD from CVS).

If you put the patch file in the gmap directory and run it with:

patch -p0 < gmap_single_map_6x-1x.patch

it should work.

It won't work properly without the -p0

agileware’s picture

Status: Needs work » Needs review
agileware’s picture

StatusFileSize
new18.06 KB

Here is a port of the patch in #6 to drupal 5.

It is a little bit improved from the original drupal 5 patch and goes with the much better drupal 5 patch in #338745: Multiple locations on a single map comment #28.

It is for gmap 5.x-1.x-dev (2009-Apr-18).

aren cambre’s picture

Tag is missing a comma.

mrgoltra’s picture

subscribing

johnmullin2003’s picture

subscribing +1

yesct’s picture

tagging... actually the tag is used on many location module issues, and this ties into that. :) adding back.

See: http://drupal.org/project/issues/search?text=&projects=&assigned=&submit...

gjmokcb’s picture

Category: feature » support

I have installed the two patches, checked the "single map" box, updated all modules, etc, but locations works exactly as before. I suspect the gmap patch, because the locations patch installs smoothly, but I get variations on this error when installing the gmap patch:

patching file gmap.module
patching file js/locpick.js
Reversed (or previously applied) patch detected! Assume -R? [n] n
Apply anyway? [n] y
Hunk #1 FAILED at 1.
File js/locpick.js is not empty after patch, as expected
1 out of 1 hunk FAILED -- saving rejects to file js/locpick.js.rej
patching file js/locpick_multi_map.js
patching file js/locpick_single_map.js

If I respond "y" to Assume -R, I still get an error. If I delete locpick.js before patching, the patch complains that it is trying to delete locpick.js but can't find it. In every variation, I end up with a failed hunk.

Am I doing something wrong?

gjmokcb’s picture

Clarification: I installed the patch thusly: patch -p0 < gmap_single_map_6x-1x.patch

aren cambre’s picture

Category: support » feature

(reverting category)

agileware’s picture

@gjmokcb:
I will be having a look at a couple of minor bugs within the next week so I'll check out your error then.

Chris Einkauf’s picture

Subscribing

alxp’s picture

Subscribing

rooby’s picture

Assigned: agileware » rooby

I have done a lot of work on this (I work for Justin) and there is not really any free time for us to be working on this at the moment so I will do it in my own time.

I hope to get to it pretty soon and fix up a few more details.

klonos’s picture

subscribing...

rooby’s picture

StatusFileSize
new17.85 KB

Here is the D6 patch for 6.x-1.1.
I have not had time to even test that it works, it is just a direct re-roll of the existing patch.
I noticed there are definitely things I would like to do a little differently with the patch in terms of code so it will need a bit of work when I get back.
But functionality wise it can still be reviewed so setting to needs review so people test.

I haven't got time to check the polygon patch so I'll do that later if no one else gets to it.

larowlan’s picture

Patch at 23 works for me against 6.x-1.1

teckcrew1’s picture

I am also interested to see how your doing on this patch. Looking for a way to add polygons to gmaps with locations.

teckcrew1’s picture

StatusFileSize
new13.73 KB
new210.97 KB

rooby, Algileware,

I installed this patch but am getting some unexpected behavior. I have set my CCK to use multiple locations (see attached files) but when I create that node, I do get 1 map, but each time I click the map, the coordinates update each location with the same lat & long coordinates, and ONLY 1 marker is ever displayed on the map. As I click a new point, the marker moves to that new point. I expected this would allow me to add multiple locations on the same map.

Please tell me what I am missing???

rooby’s picture

@teckcrew1:

I have not yet tested this with cck locations yet, only node locations.
I would assume that this would not work with cck locations yet, but that is one of the first things I will be looking at when I get back into this.

I've had lots of things keeping me away from it lately and I have to move house this week so it won't be until next week I get back into these patches.

bdragon’s picture

Status: Needs review » Needs work

A) Splitting files here is wrong. There can be an arbitrary number of maps on the page. You can't do mutally exclusive inclusion of files. Using a behavior flag is better.
B) I'd rather it use a separate set of events to differentiate it from the single point locpick. Some sites may have listeners on the events and changing stuff here can screw them up.
C) Doing it as an editable polygon is more responsive in my experience.

Actually, I should probabaly do a rewrite of locpick in general, it's not very good code.

rooby’s picture

Yeah, I came back to this a few weeks ago and ran into much trouble in relation to the two locpick files and came to the same conclusion, it definitely has to all be in the one locpick file, but I ran out of time and haven't got bcak to it yet.
It'll be much cleaner code then too and it will pretty much fix all the other somewhat dodgy parts in the current patch.

nwnolte’s picture

EDIT: Sorry, this was meant for Multiple locations on a single map.