1

Topic: Google map duplicated when jCaption installed

I have always struggled to find a good way of supporting user-defined image captions in Drupal 7 so was pleased this week to have found the jCaption module which exposes title (or alt) text as a caption constrained within the width of its image.

However this breaks the Google maps support in Indicia Forms. With jCaption enabled, I now see two copies of the map, the second mostly hidden, and neither of which show any mapping detail on initial load. The location controls work only in the second map, but the map layer controls work separately on each map.

I am guessing this is some kind of jQuery conflict. Does anyone else have experience of this and how to resolve it?

I am running jCaption 7.x-1.4 on Drupal 7.41 using Indicia on the test warehouse.

Thanks, Chris

Chris Dee
Garganey Consulting

2

Re: Google map duplicated when jCaption installed

I haven't any experience of this but I have certainly shared your pain trying to create image captions in Drupal 7. I believe it is improved in Drupal 8.

Jim Bacon.

3

Re: Google map duplicated when jCaption installed

Chris
It's worth checking on the page for a few things. jCaption shouldn't do any of these but it's worth a shot:
1) Are there more than 1 reference to jQuery.js on the page?
2) If you debug the page using your favourite JS debugger, does the call to setup indiciaMapPanel get called more than once, or are there more than one of these calls on the page?
Cheers
John

John van Breda
Biodiverse IT

4

Re: Google map duplicated when jCaption installed

jCaption isn't by any chance, trying to put a caption on the map is it?

Jim Bacon.

5

Re: Google map duplicated when jCaption installed

All fixed now.

The jCaption module allows specification of the CSS selectors to be targeted, and I hadn't notoiced that it deafults to all unqualified img elements. Making that more specific to images within regular Drupal nodes (e.g. '.field img' and
'.field-item img') stopped it from interfering with the Google maps image.

So jCaption is still my favourite Drupal 7 caption management module.

Chris

Chris Dee
Garganey Consulting