Hello

I've created a patch for the gmap module. This goes under feature enhancement. It enables the use of the extinfowindow to style the info window for markers. Custom theme can be easily created. I've included a tutorial in the README.txt file in the extinfowindow directory.

This patch is compatible with the latest dev version 6.x-1.x-dev - 2010-Apr-09

To install, apply the patch. Download the extinfowindow attached here. Extract under /sites/all/modules/gmap/thirdparty.

You can enable the extinfowindow at http://example.com/admin/settings/gmap .

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hutch’s picture

patch is missing ;-(

shadcn’s picture

Status: Needs review » Active

A working example can be found here : http://www.preprocess.me/map/user

shadcn’s picture

FileSize
10.59 KB
3.5 KB

My mistake. uploading patch.

hutch’s picture

Wow, I'm impressed!

hutch’s picture

Status: Active » Needs work

Well I'm afraid there are still a few problems with the patch, it failed to work on current dev.

~/work/tmp/gmap > patch -p0 < gmap_6.patch
patching file gmap.module
Hunk #1 succeeded at 264 (offset 22 lines).
Hunk #2 FAILED at 273.
Hunk #3 succeeded at 1264 (offset 86 lines).
1 out of 3 hunks FAILED -- saving rejects to file gmap.module.rej
patching file js/marker.js
Hunk #1 FAILED at 44.
1 out of 1 hunk FAILED -- saving rejects to file js/marker.js.rej

This is because the patch was made on DRUPAL-6--1-0 the current stable which is pretty old.
However, I could see what was intended so I hacked the bits in to gmap.module and marker.js.

I cannot enable it under admin/settings/gmap, there is no change there nor do I see any code that would alter the settings form, so I suspect there is a bit missing to patch gmap_settings_gui.inc and provide the checkbox (or whatever) to enable extinfowindow.
If you can get that to me, or rework your patch on current dev, DRUPAL-6--1 and post it here I'll have another go ;-)

On the basis of what I've seen on your example site this is probably of interest to plenty of others, just need to get it going right.

shadcn’s picture

ok let me check this asap.

shadcn’s picture

Status: Needs work » Needs review
FileSize
201.47 KB
10.65 KB
4.71 KB

A new patch for the DRUPAL-6--1 branch. I'm attaching the patch, the extinfowindow, and a sample working module.

Thanks

hutch’s picture

Thanks for the prompt response, I'll have a look shortly.

hutch’s picture

Patch is clean and it all works. It does not honor 'hide' settings but then the regular balloon does not either so not the fault of extinfowindow ;-)
This is a good addition to gmap.

KrisBulman’s picture

wow, finally!

ayalon’s picture

Cool! Finally someone did it! Thanks a lot!

KrisBulman’s picture

Status: Active » Needs review

is it in dev?

KrisBulman’s picture

will this go into the module?

ahkiam’s picture

awesome patch; thanks.

shadcn’s picture

it seems there's a lot on the maintainers right now but i've included both the patch and a modified dev version here we can test/use.

shadcn’s picture

Patch is being reviewed by rooby. He'll commit asap.

rooby’s picture

Awesome functionality.

Coincidentally I just had a client site that required this, which further prompted my testing.

Seems to work well without issues using the supplied themes.

I made my own theme though (an exact copy of light) and I got unexpected results when clicking markers.
On marker click the marker had no background and the map scrolled all the way around.

I'm assuming this might just be me from other people reviews so I will see.
Has anyone else seen this behavior?

I'll have a bit better look through it when I'm at home but so far it looks great.

Another thing that would be nice is if the themes could be picked up from the sites theme instead of the gmap module. That would be better for upgrading, but it's something that can be added later, I'm just thinking out loud.

shadcn’s picture

Hello rooby

Thanks for your time. I had the same issue with some themes too. its not in the php but in the css. i solved it by putting a width for the main bubble container. when the width is set to auto, it tends to take infinite width and hence, lose the background and spread over the map width.

#opacity_window{
  width: 200px;
}

Can you try a width and let me know? if it doesnt work, i'll be glad to help with the theme.

Thanks

davepoon’s picture

Excellent feature patch, thank you!

shadcn’s picture

im bumping this because i've not seen anything on this for some weeks now. let me know where we stand.

hutch’s picture

As I said in #9, This is a good addition to gmap.
Please consider weaving this in to the next dev release ;-)

rooby’s picture

Finally got back to it.

I had ideas to expand on this functionality. Check out this version and let me know what you think.
Changes I've made are:
* Made it so that it looks for extinfowindow themes in the current theme in a directory called extinfowindow (this way updating the gmap module won't mess up your themes and it is more in line with how drupal theming generally works)
- If a theme in that directory has the same name as a default theme it will override the default theme. Documentation has been updated.
* Allowed theme selection in views settings so different views can use different themes
* Allowed theme selection in gmap macros (in the format extinfowindow=themename)
- GMAP-MACRO-DICTIONARY.txt has been updated.
* Code cleanup. Mostly regarding the use of spaces.

Note: with the new options it is possible to have different themes on different maps on the same page.
In this case the first theme loaded will be used for all maps to avoid any weirdness that might happen if multiple theme css files are loaded.

(I just realised that if you have the extinfowindow enabled checkbox unchecked for views they will probably still use the extwindow theme specified on the gmap settings page. - I will fix that when I get a few minutes)

rooby’s picture

Also, I have seen the problem #17 again on a different system.
Even when width is set as mentioned in #18.

To reproduce:
1. Copy a theme (for example: light)
2. Rename the theme directory to test and it's css to test.css
3. Select the theme test
4. When you view your map and click the marker you get odd results. (no background on the pop-up and the map scrolls right around)

Can anyone else reproduce this?

I will investigate further soon.

[edit] Using garland as the theme.

shadcn’s picture

Let me test this. Thanks.

rooby’s picture

FileSize
18.04 KB

Here is an updated version.

Everything is in the one patch now, just apply the patch and you're good to go.

Changes are:
* Changed so that the extinfowindow plugin does not ship with the module. You have to download it from http://gmaps-utility-library-dev.googlecode.com/svn/tags/extinfowindow/1... - There are instructions for this in the extinfowindow readme and also on the gmap settings screen. I did this so it is the same as all the existing plugins, which require the user to download them separately.
* Fixed the issue I mentioned in #22 where views will still use extinfowindow even if it is unchecked for that view. - To fix this issue I removed the theme selection option from the gmap settings screen. There is no need for this default theme setting because you can specify a theme in a gmap macro and gmap views have an option to choose a theme. So if no theme is specified it drops back to the default google maps pop-up.
- Actually, thinking about that now, maybe there could be a default theme for macros. Views probably don't need a default, although they could use one that is just used as the default value in the views settings form.

If you have any suggestions on how a default setting might work and be useful please voice them. I'm just looking to get the best functionality possible.

I still have to do some testing re the bug in #23.

If anyone else is testing this please give feedback.
It would be great to get it in the next release.
Thanks.

hutch’s picture

Done some testing on patch in #25
The images are missing from dark and light themes so I copied them in and now they work OK
images and patches don't go well together for obious reasons but thought I'd mention it anyway ;-)

macro:
added |extinfowindow=light to the location_node macro, OK, ditto location_user
added |extinfowindow=light to CCK location macro, OK

followed the instructions for adding a themed infowindow to my theme, works fine'

I don't seem to have a gmap View so did not test that.

Personally I would prefer to be able to state which theme to apply to any infowindow on the whole site (global default) in gmap settings but if that is problematic so be it.

So far so good!

rooby’s picture

Damn, I knew there was a reason I didn't put it all into one patch last time.

We can easily go the one default option as that was what the original patch did.
I've been thinking the same thing as you, it probably would be better with just one default to keep consistency across your website.
Good to hear the same thing from someone else for confirmation.

Might go back to a cross between the current and the original.
The one default setting from the original + the ability to have your theme in your theme instead of in the gmap folder and not including the plugin in the gmap download.

rooby’s picture

Here is an update that brings it back to one default theme setting across the site.
Much simpler.

And in the interest of simplification, what do you think about the having the ability to have the extinfowindow themes your theme as opposed to in the gmap folder?
On one hand it is better for updating gmap and keeping in line with having theming in your theme.
On the other it makes the code more complex and because you when you update gmap you already have to be careful of anything you have added to the thirdparty directory so it might be ok for people to also be careful of any extinfowindow themes they might have in there.

I'm tempted by the simplicity of the original system of all in the gmap directory.

hutch’s picture

I'll test this ASAP, 'real' work keeps getting in the way ;-)

hutch’s picture

I have installed the version in #28 and it all works but with some interesting quirks
The extinfowindow I selected in admin/settings/gmap works, but the one I poked into my theme does not, even though it appears under the jQuery.extend(Drupal.settings,.... string. hmmm
If I remove the theme version the default continues to prevail and if I add extinfowindow to the gmap macro it is ignored too.
So Drupal.settings are being overridden

egomac’s picture

Subscribing.

Can this make it to the core gmap module?

KrisBulman’s picture

Has this made it into core yet?

rooby’s picture

Status: Needs review » Needs work

Nope but it's right near the top of my list of things to get working.

Things outstanding for this are:
1. Re-roll for the current dev (Maybe - I'm not sure if it applies as I haven't checked in a while)
2. As far as I know, the bug in #23 is still present and it can't really go in until that is resolved. Can anyone else reproduce that bug?
3. There is a question posed in #28 regarding where people should have to put their themes.
4. Hutch had some issues in #30 that need investigation.

So after I have finished on the location/gmap single map patches and the gmap polygons patches I will come back to this one.

And then hopefully I can find some time to do some work on the location/gmap D7 versions.

hutch’s picture

I will revisit #30. I will also reroll patch gmap-774078-28.patch
back as soon as I can find some time ;-)

shadcn’s picture

Ok I'll be on this too. Let's make this happen.

hutch’s picture

FileSize
9.51 KB

Here is the fresh patch, none of the issues addressed as yet.

pacome’s picture

subscribing

rooby’s picture

Status: Needs work » Needs review

Awesome, thanks for doing that hutch, I'll review as soon as I can.

hutch’s picture

FileSize
10.48 KB

Rerolled patch for current dev, please review, this works well for me.

don_ciccio’s picture

The patch at #39 is not working with the latest dev. Any hints?
edit: nevermind, I just had to select "open info window" in gmap settings

arnold_mad’s picture

when will this come to dev version and could someone append a current dev version ?

hutch’s picture

FileSize
9.87 KB

This patch runs cleanly on current CVS

arnold_mad’s picture

thx for the new patch - how can I activate the ExtInfoWindow ?

hutch’s picture

You will need the tar.gz in #7

hutch’s picture

FileSize
10.3 KB

Patch on latest CVS

rooby’s picture

Thanks for the rerolls hutch.

I was just looking at this again for a client and saw the same problem mentioned in #17 & #23.
The problem seems to be that it breaks if the theme has a tilde (backup) file in it.

So I have the light theme with the light.css file in it and everything works as expected.
After I have edited the light.css file my directory contains:
light.css
light.css~

Now it is broken.
Then if I delete light.css~ it works properly again.

So that seems to be the issue.
I'll have a poke around for the cause of the issue later.

rooby’s picture

Status: Needs review » Needs work
+++ gmap.module	3 Feb 2011 16:09:37 -0000
@@ -1278,6 +1283,85 @@ function gmap_views_plugins() {
+  $default_themes = file_scan_directory($default_path, '.css');
+  $themes = file_scan_directory($theme_path . '/extinfowindow', '.css');

This is the cause of that problem.

It should probably be:

+  $default_themes = file_scan_directory($default_path, '.css$');
+  $themes = file_scan_directory($theme_path . '/extinfowindow', '.css$');

Powered by Dreditor.

I'll roll a new patch later today.
I'll do another patch review tonight too.
That is also the main issue I had with committing this before so hopefully it can go in soon :)

hutch’s picture

I have tested the regex change and it works, I added 'dark.css~' and it was ignored.

hutch’s picture

FileSize
10.51 KB

Here is the extinfowindow tarball again, with unneeded file removed and the js file cleaned up to remove tabs and lines with spaces only. Code is the same.

rooby’s picture

Status: Needs work » Needs review
FileSize
3.05 KB
10.86 KB

Here is an updated version of the whole kit.
Changes are (from #45 & #49):

  • Regexp fix from #47.
  • Removed the extinfowindow.js file from the tar.gz file because we can't include it due to it not being licensed under GPL and all the other add-ons are not included either.
  • Added a link to the settings page to the download page for extinfowindow.js.
  • Added a filename field to the settings page like the other add-ons have, so users can select whether to use the regular or the packed file (the packed file is the default).
  • Removed the "Use extinfowindow for pop-ups" option from the views style so the only option is the theme selection (which is only available if extinfowindow is enables on the gmap settings page).
    This is because when enabled on the main settings page all maps across the site will use extinfowindow. Then the theme can be either the default as set on the settings page, a theme specified in a macro, or a theme specified in a view.
  • Some minor code comment changes.
  • Some minor field description changes.

I have tested with the supplied themes, an overridden 'light' theme in garland and a new custom theme in garland.

All seems to work for me.

The problem hutch reported in #30 may have also been due to the regexp bug.
I'll do a little more testing and see if I can make anything break.
Then I think that's all the outstanding issues.

Patch rolled against current CVS.

hutch’s picture

Finally got around to looking at this, the patch is fine and it all works except that I cannot get extinfowindow_packed.js to work at all, only extinfowindow.js. In Firefox, not tested anywhere else, not using any aggregation in drupal.

The attached patch is git-style on the latest clone, you will need to use patch -p1 < gmap-extinfowindow-774078-51.patch or git apply gmap-extinfowindow-774078-51.patch if you are working in a git clone.

rooby’s picture

Status: Needs review » Needs work

I found another annoying issue.

If you have custom extinfowindow themes in your theme and are using a different admin theme you will run into trouble.
When on the admin pages, where the theme selection options are, the list of themes is generated from the current theme (admin theme). But you will have your extinfowindow themes in the main theme, not the admin theme so they don't get listed.

So either that setup needs reworking or removing.
Another solution could be to have extinfowindow and it's themes in sites/all/libraries.

Also, it would be good to change all the thirdparty addons for gmap in into the libraries directory.
So maybe that can be achieved in another issue, which would then provide a solution for this too.

rooby’s picture

msathesh’s picture

#51 's solution worked for me with dev version. Thanks for the patch.

How to override the element's hard coded CSS? For example, if I wanted the infowindow to be opened on the right side of the marker instead of top.

hutch’s picture

The positioning of the infowindow has to be calculated to allow for the bounds of the map, so this feature would have to be added to extinfowindow.js

Shven’s picture

patch #51 did the job!

matt-kinetic’s picture

Category: feature » support

I've applied the #51 patch works like a dream.

aaronpinero’s picture

Hey, is there any chance this patch could be revised for use with the D7 version of the module? Or is that already in there and I'm just looking in the wrong place?

HenrikBak’s picture

I would also like to know if this patch applies for D7 version.

rooby’s picture

I haven't done any work on the drupal 7 branch but I would say that this isn't in there because it was a direct port of the drupal 6 version, which doesn't contain this yet.

I would think this patch could be ported to drupal 7, without having to change too much.

hutch’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
FileSize
9.75 KB
14.22 KB

Attached is a patch for gmap D7, made on current dev
Also attached is a tarball, this needs to be unpacked into your libraries folder. It contains the original extinfowindow.js and the packed version, plus a couple of themes.

You should also ensure that the libraries module is installed.

HenrikBak’s picture

Thanks hutch, it works perfectly!

KrisBulman’s picture

Status: Needs work » Needs review
rooby’s picture

Status: Needs review » Needs work

See #52 for why it is marked needs work.
If we can sort that out this can finally be committed.

(thanks hutch for the port)

hutch’s picture

Re the issues in #52
extinfowindow and it's themes are in the libraries folder.

If I copy 'libraries/extinfowindow/themes/light' to 'themes/mytheme/extinfowindow/light1' and rename light.css to light1.css and just change the background color so I can tell if it's working, it appears in the dropdown list in admin/config/services/gmap (which is running in the admin overlay 'seven'). I then select 'light1', save config and have a look in the 'Node locations' link on the Navigation menu, click on a marker and extinfowindow box appears in the light1 style. I also added 'light2' in the same way as above and it works too.

I am currently using a Genesis based theme.

in function gmap_extinfowindow_themes() in gmap.module line 1378 there is a line "global $theme;", this can be removed, it does nothing and is probably left over from previous incarnations.

Could others please test this so we can put this to bed ;-)

rooby’s picture

I will have a play around on the weekend, I'd love to close this one.

webservant316’s picture

Wow I would love to use this patch, however, it didn't install well for me. I am using Drupal 6.25 and gmap-6x.1.x-dev.

1. Perhaps it doesn't play well with this patch that I am also using -http://drupal.org/node/1139088.
2. Perhaps it doesn't play well with the zen sub-theme. I tried putting the theme files in my sub-theme folder renamed to my sub-theme and also into the main zen folder remained to zen. Neither effort worked.

The symptom was that clicking on a marker resulted in no pop-up at all. Except the 'list' pop-up from the multiple location patch mentioned above (http://drupal.org/node/1139088) did continue to work. I suspect that the two patches do not work well together.

Currently I need to fix a few things for gmap to go into production on my site, and was hopeful that this patch could help me.
1. The pop-up bubble display, if bigger than the map viewport, is clipped by the 'overflow: hidden' directive. I was hoping this patch would fix that and display the pop-up outside the map viewport. However, I also need the patch above to deal with links to multiple map/nodes at the exact same location and it doesn't play well with this patch.
2. I also need to figure out how to turn off the marker action for single markers on a node map.

Still searching the issue queue for solutions,

Jeff

webservant316’s picture

I was able to use css effectively without this patch as described here http://drupal.org/node/1139088#comment-5956720.

hadim’s picture

Your plugin seems great and the way to add this feature very interesting. Any chance to make it work with last rewriting Gmap module to work with Google Maps API v3 : 7.x-2.x-dev available here: http://drupal.org/node/1532336 ?

Sorry for the non related comment (this issue seems pretty active so I ask here) but Gmap development seems dead ? Are the developpers still here ? I got no answer for these issues : #1218870: Marker managers give wrong path to marker icon when Drupal is not installed at root and #1565792: MarkerClusterer is not working.

Cheers,