[Module] Google Maps - Issues with Mini Google Map: unexpected zoom levels, missing item markers, map type

kswartz

Joined: 2007-09-13
Posts: 12
Posted: Thu, 2011-06-09 20:51

Hi there,

I recently upgraded to Gallery 2.3 and enabled the Google Maps module. I've spent a lot of time experimenting with the settings, and have most of its features working, but still have some issues with the Photo Location Map and Album Location Map that appear on photo and album pages respectively. I'd really appreciate a review to see if there are settings I'm not managing correctly to get the expected/desired behavior.

I've listed my Gallery and Google Maps module settings below.

1. In the theme settings for my album, I set the "Album page: Show Item Markers" property for the Mini Google Map to a value other than None. If I have provided GPS coordinates and ZoomLevel for my album, then it does not show anything -- only the album marker, if I've also checked that box. If I do not provide a GPS and ZoomLevel for my album, then it DOES show all markers for all the photos in the album; however, the default zoom is 1, so it requires a lot of zooming/recentering to get there. How can I get it to show all item makers AND use a default zoom -- either specified or computed to fit? (Note: the map ignores the ZoomLevel in Album > Google Map Settings if GPS coordinates are not given.)

2. I have GPS coordinates set on all of the photos in an album, and I've also added one to the album itself, along with a ZoomLevel. However, the photo location map is not using the zoom level for the album. Instead, it uses the "Default Zoom In Level" value from Site Admin > Theme Settings > InfoWindow Settings. This runs a bit contrary to what was explained at http://gallery.menalto.com/node/90651 ; from there, I interpreted that the settings on the Map tab for the album (or photo) should take precedence, but they don't.

3. Last one may turn out to be a feature request. Is there a way to add the controls for map type to either the Photo Location Map or Album Location Map, so the user can override what was set in the album theme?

My thanks in advance for any information that can help fix these issues. Note that setting the zoom level for every individual photo is not going to be scalable for me (it needs to be at the album level), so hopefully that is not my only option.

Thanks in advance,
Keith

Module Info:

Module name & version : Google Map 0.5.8
General > Map Settings : Auto Center and Zoom, Show Map Filtered on Current Album
General > Features Enabled : Google Overview, Theme, Marker Sets, Filter
Theme Settings > Map Control Size = Stock - small (or Stock - large), Show Map Type checked
Theme Settings > InfoWindow Settings : default template, zoom=15, Show Zoom In, Show Item Summaries
Album Settings > Map tab : GPS and zoom level provided
Album Settings > Theme / Google Map Tabs : (see problem description above)

Gallery Info:

Gallery version : 2.3.1
Theme : Floatrix 1.0.8
PHP version : 5.2.17
Browser : Firefox 4.0, Firefox 3.6, IE 8

 
kswartz

Joined: 2007-09-13
Posts: 12
Posted: Thu, 2011-06-09 21:05

Oops! Issue #2 is solved.

Turns out: a) you do need to have GPS coordinates and a ZoomLevel, but b) it has to be near the item markers. I mistakenly had the wrong GPS coordinates for the album, so the item markers WERE being displayed, it was just off the screen. (In my defense, the right and wrong GPS coordinates were in the middle of a national forest, so it wasn't obvious that it was wrong for some time. :) )

Still would appreciate input on #1 and, before I try going in to customize the code, #3.

Keith

 
kswartz

Joined: 2007-09-13
Posts: 12
Posted: Thu, 2011-06-09 21:41

Issue #3 is also solved now, having found the template file. The answer is, it can't be done via the UI today. However, for those that desire this functionality, the following changes to modules/map/templates/blocks/MiniMap.tpl will display the map type controls if "Enable pan and zoom controls" is checked (in the block parameters under theme settings), and default the map to the map type selected there.

25c25,26
<       {ldelim}mapTypes:[{if $mapType eq 1}G_NORMAL_MAP{elseif $mapType eq 2}G_SATELLITE_MAP{else}G_HYBRID_MAP{/if}]{rdelim});
---
>     {* {ldelim}mapTypes:[{if $mapType eq 1}G_NORMAL_MAP{elseif $mapType eq 2}G_SATELLITE_MAP{else}G_HYBRID_MAP{/if}]{rdelim}); *}
>       {ldelim}mapTypes:[G_NORMAL_MAP,G_SATELLITE_MAP,G_HYBRID_MAP]{rdelim});
59a61
>     map.setMapType({if $mapType eq 1}G_NORMAL_MAP{elseif $mapType eq 2}G_SATELLITE_MAP{else}G_HYBRID_MAP{/if});
61a64
>     map.addControl(new GMapTypeControl());