Map Theme (Google Map)

steph33560

Joined: 2008-01-11
Posts: 14
Posted: Fri, 2008-01-11 15:32

Hi,

I would like to setup a gallery and present my albums on a map instead of a folders listing.

I've seen that there is a theme "Map" based on the plugin which uses Google Map.

To test it I've used Gallery v2.2 RC 1, Apache 2.2.6 and PHP v5.2.5.

Alas, when used with the latest version of Gallery, it seems that it does not work : the theme is not underlined, when the mouse is over the name, no example is displayed, and clicking on "install" do nothing.

Google Map module is working, it's possible to display albums & pics on a map... So I think the problem comes from the theme (v2.1 compliant only ?)

Have you got any information about it ?
Thanks :)

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2008-01-11 15:53

Nobody has maintained the map theme once the map module came about. So I suspect that is is only G2.1 compliant.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
steph33560

Joined: 2008-01-11
Posts: 14
Posted: Fri, 2008-01-11 17:33

Well :(

Is there any tutorial to maintain it ?
A migration guide which let me easily to how to upgrade it ?

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Fri, 2008-01-11 19:14

What I would like to do is to split out some of the functionality into a common module which simply has the latitude & longitude coordinates (call it geodata maybe?). Then the data could be used by either the theme or the module, or by any other future plugin. If we did that, then it would make sense to bring the map theme up to Gallery 2.3 standards. I don't know if Termitenshort will support this idea, though.

 
steph33560

Joined: 2008-01-11
Posts: 14
Posted: Fri, 2008-01-11 19:44

In fact, do you want to make a new simplier implementation of the Google Maps API ?

I mean, the Map module what lastly updated on 2007-12-27... it might not be as deprecated as people can think using it theme !

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2008-01-11 19:57

Making modules dependent on other modules is not a good idea. (splitting some function of the map module to let the map theme use) It gets hard to maintain and we see that already with the map theme not being maintained. If we did that then there would be 3 items to maintain and there simply is not enough people to go round.

There is not a tutorial to maintain things (modules and themes) but there is some API documentation that the average theme developer would not get anyway:
http://codex.gallery2.org/Gallery2:API I would start with looking at existing themes and see what code have changed between versions. Also with Google map code changing from V1 to V2 a developer has to be knowledgeable on that API as well.
Sure we know documentation is lacking but there is only so much time in a day & there is only a few of us on the team.

steph33560, Do you have experience in creating themes? First you would have to be good at that, before tying to upgrade a theme that has not been maintained..
What functionality is lacking in the module that the theme had?

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2008-01-11 20:12
steph33560 wrote:
In fact, do you want to make a new simplier implementation of the Google Maps API ?

I mean, the Map module what lastly updated on 2007-12-27... it might not be as deprecated as people can think using it theme !

I don't understand. Do you want a simpler module?

What features in the module are you looking for that the theme had?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
steph33560

Joined: 2008-01-11
Posts: 14
Posted: Fri, 2008-01-11 21:11
floridave wrote:
Making modules dependent on other modules is not a good idea. (splitting some function of the map module to let the map theme use) It gets hard to maintain and we see that already with the map theme not being maintained. If we did that then there would be 3 items to maintain and there simply is not enough people to go round.

I totally agree this but...

floridave wrote:
There is not a tutorial to maintain things (modules and themes) but there is some API documentation that the average theme developer would not get anyway:
http://codex.gallery2.org/Gallery2:API I would start with looking at existing themes and see what code have changed between versions. Also with Google map code changing from V1 to V2 a developer has to be knowledgeable on that API as well.
Sure we know documentation is lacking but there is only so much time in a day & there is only a few of us on the team.

In fact, Map module depends on another module : this module is Google Map... maybe the difficulty would come from interfaces : if Google changes it between version X and version Y, it will really be unmaintainable. Then, maybe another module between Map Module and Goole Map API, with a solid protoype, would be usefull to hide changes from Google Maps core and then help Map Module easily upgradable ? I say this, but I still didn't have time to open the box...

floridave wrote:
steph33560, Do you have experience in creating themes? First you would have to be good at that, before tying to upgrade a theme that has not been maintained..

I'm a newbie, but I've got some experiences in developping applications (it's my job) so with a little bit of time and patience I think I will understand how it works. Open Source is used to be undocumented, it's not a problem ;)

floridave wrote:
What functionality is lacking in the module that the theme had?

Well, If I managed to make it work, I would say it :)
I'll have a look at this tomorrow if I've got an hour or two.

floridave wrote:
steph33560 wrote:
In fact, do you want to make a new simplier implementation of the Google Maps API ?
I mean, the Map module what lastly updated on 2007-12-27... it might not be as deprecated as people can think using it theme !

I don't understand. Do you want a simpler module?

Not at all. This module is OK for me, and I see it's the only one for Maps...

- Stéphane

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Fri, 2008-01-11 21:38
floridave wrote:
Making modules dependent on other modules is not a good idea. (splitting some function of the map module to let the map theme use) It gets hard to maintain and we see that already with the map theme not being maintained. If we did that then there would be 3 items to maintain and there simply is not enough people to go round.

Dave, if the geodata module were extremely simple it would not need much maintenance. It's just moving code around. It's like the Upload Applet depends on the Gallery Remote module to be installed. What's really missing is a way for the plugin mechanism to automatically install dependencies. That would solve a lot of the user questions (but good error messages go a long way).

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2008-01-11 23:03
steph33560 wrote:
In fact, Map module depends on another module : this module is Google Map... maybe the difficulty would come from interfaces : if Google changes it between version X and version Y, it will really be unmaintainable.

We did experience that when google changed from V1 to V2. The map module have to be re written and updated.

steph33560 wrote:
Then, maybe another module between Map Module and Goole Map API, with a solid protoype, would be usefull to hide changes from Google Maps core and then help Map Module easily upgradable ? I say this, but I still didn't have time to open the box...

We have zero control over the google map API ( other than suggestions) so if they make a change we have to change as well. I guess a solid prototype in between the Google API and the module/theme could be doable but somebody has to do it.

SiliconFiend wrote:
Dave, if the geodata module were extremely simple it would not need much maintenance. It's just moving code around. It's like the Upload Applet depends on the Gallery Remote module to be installed.

sounds like a good idea. Want to do it?

Quote:
What's really missing is a way for the plugin mechanism to automatically install dependencies.

A good admin interface would help this along the way. The comments module now has a Askimet spam filter as a non required dependency, similar as you get a key form Akisment and key from google. But the comments still functions without that dependency.
Some activation code could check for a module and not allow you to activate it until you have the correct sub-module.
All takes time and I hope you are willing to tackle this with Termite.

Dave

PS. thanks for the support on the map module.
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Sat, 2008-01-12 00:20

Yes, I do want to do it. :-) Proper handling on activation will be the key. Fortunately there is already an example to follow. Like you said, the key is going to be getting Termitenshort on board.

Sorry if support has been lagging a bit lately. I've been writing some Java code for OpenSteetMap.org, and I'm also looking for a new job since I'm in a slow-motion layoff.

 
steph33560

Joined: 2008-01-11
Posts: 14
Posted: Mon, 2008-01-14 14:26

HI,

Starting with 1.0.7 version, I've successfully modified theme.inc file (that was the easiest piece) ; the Map Theme is now installed in Gallery v2.2 :)

Nevertheless, I have some difficulties with templates...

In album.tpl, I don't understand how it can display a worldwide map on the header...

Furthermore, I do not see any map printed in the main area of my page. How make it appear ?

Edit: While reading module templates, I've understood some things. Is it possible to have source code templates from http://tautologous.com ?
Can you help me ?

Thanks.

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Mon, 2008-01-14 14:54

Sorry, I probably can't help. I've never looked at the theme code. As for getting code from another website (it's using the module, by the way), you'll have to ask the site owner.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2008-01-15 05:40

I installed map theme 1.0.7 from the themes codex page and did not make any changes.
Seems to work for me:
http://langleycom.com/gallery2/v/map/

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
steph33560

Joined: 2008-01-11
Posts: 14
Posted: Tue, 2008-01-15 17:56

Hey... I've downloaded it and copied on my filesystem.

Is there another way to do get this theme ?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2008-01-16 02:35
Quote:
Is there another way to do get this theme ?

no. Not that I am aware of. What version of Gallery do you have?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
steph33560

Joined: 2008-01-11
Posts: 14
Posted: Wed, 2008-01-16 09:20

I've downloaded latest version of Gallery v2...

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2008-01-16 14:48

Latest... as in SVN version, a nightly or 2.2.4?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
steph33560

Joined: 2008-01-11
Posts: 14
Posted: Wed, 2008-01-16 15:21

Well, see my first post :

steph33560 wrote:
I've used Gallery v2.2 RC 1, Apache 2.2.6 and PHP v5.2.5.

But I did not said that I've downloaded this 2.2RC1 directly from http://codex.gallery2.org/Downloads

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2008-01-16 19:28

Now I am confused.
Site admin -> Maintenance -> System information; run now. Post what is says

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
steph33560

Joined: 2008-01-11
Posts: 14
Posted: Wed, 2008-01-16 21:26

My Last test version was 2.2.4. Here what says system info (translated by me...)

System Information wrote:
Gallery version = 2.2.4 noyau 1.2.0.6
PHP version = 5.2.3 apache2handler
Web Server = Apache/2.2.3 (Win32) PHP/5.2.3
database = mysqli 5.0.45-community-nt, lock.system=database
toolbox =
Acceleration = none, none
OS = Windows NT GROPAF 5.1 build 2600
defaut theme = matrix
gettext = activated
Language = fr_FR
Web Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11
Number of lines in GalleryAccessMap = 3
Number of lines in GalleryAccessSubscriberMap = 1
Number of lines in GalleryUser = 2
Number of lines in GalleryItem = 1
Number of lines in GalleryAlbumItem = 1
Number of lines in GalleryCacheMap = 0

To be sure of what I've done, I've reinstalled a totally new version (new filesystem files, new database) from blank. I've donwload v1.07 theme, put it on my filesystem,; click on Install... it does nothing ...

Then I've download Google Map Module version 0.5.6 from community, configured and activated it, clicked on "Install" from the Map Theme... nothing...

I've tested this both on Firefox and IE... The Map theme does not work with gallery v2.2.4, sorry...

:(

How is it possible for you to work ?

Can you give me a (adress via pm ?) a zip file from your filesystem ??

Thanks !

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2008-01-17 03:51

http://langleycom.com/gallery2/v/map_001/

A zip file of my g2 install?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
steph33560

Joined: 2008-01-11
Posts: 14
Posted: Thu, 2008-01-17 08:30

Well, I'm really confused too...It works...

Yes, may you give me a zip file of your complete G2 install (without config file if you want ;))

 
oceco

Joined: 2007-10-22
Posts: 666
Posted: Thu, 2008-01-17 15:19
Quote:
I would like to setup a gallery and present my albums on a map instead of a folders listing.

Quote:
I've tested this both on Firefox and IE... The Map theme does not work with gallery v2.2.4,

here you can see how the map module works within Gallery2 2.2.4. Even with the newest releasse of Google Earth 4.2 it works. I use FF 2.0.11.

Open Google Maps or Earth in the sidebar.

I'm still experimenting with the module and not everyting is setup as I want.

Sorry for jumping into this thread without having read it totaly.

rgds/oceco

Edit: the 2nd quote got the wrong content from my clipboard. Now its correct.

 
steph33560

Joined: 2008-01-11
Posts: 14
Posted: Thu, 2008-01-17 13:39

Am I the only one person on (google) earth experiencing problems on using theme map ?

I don't know what does not work on my way of using this :
1/ Download latest gallery2 version
2/ create a database
3/ setup gallery2
4/ get map module with the administration backend
5/ install the module and configure it (get key)
6/ download the map theme & unzip it themes' folder
7/ try to click install => bug => click does nothing

I'll try later to make it work...

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2008-01-17 14:29

PM me admin user info and turn debug on in config.php and I will have a look.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
oceco

Joined: 2007-10-22
Posts: 666
Posted: Thu, 2008-01-17 15:10

OK, meanwhile I've read the whole thread, read it again and then I was confused...

Quote:
I've download Google Map Module version 0.5.6 from community, configured and activated it, clicked on "Install" from the Map Theme... nothing...

Stepn33560, are you aware that the maps module and the maps theme are two completly different and independent elements?
BTW: I've no experience with the maps theme because it's development stopped when the maps module came up.

But I assume steph33560 wants to achive the same as I want, and a good example of this is shown here: http://tautologous.com/gallery2/travel/

Looking at this example each subalbum there has a Google Map in the header with markers (geotags) of its subalbums or photos which are geotaged.
Therefore we will need a capability to geotag albums (and maybe also your photos/images). This is possible with the maps module. The maps module is able to show a map within an album page with markers for each of its geotaged elements (subalbums and / or photos). Thats what you can see on my page.

But, steph, if I understood you correctly, you want to have this map in the header of the album page. Correct? At least it's my intention for my gallery.

So the question is: How to bring the map from the maps module in the header of an album page?

That I haven't investigated that so far. I'm sorry! But sooner or later I will.

rgds/oceco

 
oceco

Joined: 2007-10-22
Posts: 666
Posted: Thu, 2008-01-17 15:14
Quote:
6/ download the map theme & unzip it themes' folder
7/ try to click install => bug => click does nothing

Why do you do that? What you want to achieve with it? See also my previous posting.

Rgds/oceco

 
steph33560

Joined: 2008-01-11
Posts: 14
Posted: Thu, 2008-01-17 15:26

@oreco :
The Map Module isn't the Theme Map Module.
I would like to see this theme working, to build mine from it.
Sorry, but I do not understand what you say in your last post...Do you mean that theme map is useless to display albums on a map ? I agree if you build your own theme... is that what you've done on your site ?

if you have build your own theme can you share it please ?

 
oceco

Joined: 2007-10-22
Posts: 666
Posted: Thu, 2008-01-17 15:43

@steph

as I have no experience with the map theme i would never say its useless, but it's maintenance is stopped because of the maps module!
Therefore I think sooner or later you will run into problems anyway!

Why don't you use the maps module and modify a standard theme?

Again: What you want to achieve?

rgds/oceco

 
oceco

Joined: 2007-10-22
Posts: 666
Posted: Thu, 2008-01-17 15:52

@steph

if you look at my website here you will notice that all the functionality is there: geotaged albums and photos. For all of them I can get a map with markers in it and even export an album to Google Earth. This is all done with the maps module which can be used in any theme!!!

have fun with my gallery!

rgds/oceco

 
oceco

Joined: 2007-10-22
Posts: 666
Posted: Thu, 2008-01-17 16:06
Quote:
The Map Module isn't the Theme Map Module.

That's exacly what I try to explain you from the beginning! Forget the maps theme, it's a dead end.

Why do you install the map module and the maps theme? The maps theme is replaced by the maps module!!!

Quote:
if you have build your own theme can you share it please ?

I use a standard theme (carbon slightly modified).

I still asume you want to get a page like this one here: http://tautologous.com/gallery2/travel/

Correct?

Then the only trick is how to modify your template to have the maps module display the map in the header of your page instead of in the content area.

rgds/oceco

 
oceco

Joined: 2007-10-22
Posts: 666
Posted: Thu, 2008-01-17 16:35

Where to modify the header of your page?

In your template theme.tpl (make a copy into the local folder before modifying!)

We have to modify the section where the header of your album is generated. It looks like this

Quote:
<div id="gsHeader">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="top" width="50%">
<a href="{g->url}">
{if !empty($theme.params.logoImageLocation)}
<img src="{$theme.params.logoImageLocation}" alt=""/>
{else}
<img src="{g->url href="images/galleryLogo_sm.gif"}" width="107" height="48" alt=""/>
{/if}
</a>
</td>
<td align="right" valign="top">
{g->theme include="ads.tpl"}
</td>
</tr>
</table>
</div>

Now we now where! Next question is: Replace whith what?

Or more precisly: How does the maps module write its output (the map) into a page?

An investigating oceco

 
oceco

Joined: 2007-10-22
Posts: 666
Posted: Thu, 2008-01-17 16:42

How and where is the content of a site generated?

In theme.tpl in this section:

Quote:
{* Include the appropriate content type for the page we want to draw. *}
{if $theme.pageType == 'album'}
{g->theme include="album.tpl"}
{elseif $theme.pageType == 'photo'}
{g->theme include="photo.tpl"}
{elseif $theme.pageType == 'admin'}
{g->theme include="admin.tpl"}
{elseif $theme.pageType == 'module'}
{g->theme include="module.tpl"}
{/if}

As the maps module is a module it most probably will use this part of the above:

Quote:
{g->theme include="module.tpl"}

the maps module uses therefore the module.tpl

further investigating oceco

 
oceco

Joined: 2007-10-22
Posts: 666
Posted: Thu, 2008-01-17 16:48

module.tpl is quite short, basically just this:

Quote:
{include file="gallery:`$theme.moduleTemplate`" l10Domain=$theme.moduleL10Domain}

Somebody any idea where I'll find some more information about this?

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Thu, 2008-01-17 17:12

You could try adding this block statement to show the mini map:
{g->block type="map.MiniMap" item=$theme.item mapHeight=200 mapWidth="100%" mapType=3 showControls=false useParentCoords=true albumMarker=true albumItems=true}

Obviously adjust the parameters to suit your needs.

 
oceco

Joined: 2007-10-22
Posts: 666
Posted: Thu, 2008-01-17 18:20

Hi SiliconFiend

Thanks for your reply! I'm not quite sure if I understand you, therefore: Do I have to put this in theme.tpl in the <div id="gsHeader"> ....</div> and this map will then show all my geotaged elements in the site header?

Thanks again/oceco

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Thu, 2008-01-17 20:38

You can experiment with its placement. I tried putting it just above the {if $theme.pageType == 'album'} line (in the Matrix theme). You might want to also fine-tune it so it doesn't show up in Admin pages, so surround it with an if block like so:

{if $theme.pageType == 'album' or $theme.pageType == 'photo'}
{g->block type="map.MiniMap" item=$theme.item mapHeight=200 mapWidth="100%" mapType=3 showControls=false useParentCoords=true albumMarker=true albumItems=true}
{/if}

Note that you have to have the Map module installed, and you have to have a valid Google Maps API key for this to work (see the Google Map Admin section). If you can see your main map page, then you should be good.

 
oceco

Joined: 2007-10-22
Posts: 666
Posted: Thu, 2008-01-17 22:14

Ooohhh ... I see what you mean: GREAT! And THANKS a lot!!!

But may I bother you one more time? I'd like to see also an if-stmt if there are no geotaged elements in the album or photo page the block should not be shown.

I'm a newcomer and haven't learned enough about the concept, structure etc. of Gallery2. My gallery is up and running only since three weeks now and im still an user scratching only on its surface and still trying to understand all the features of this GREAT maps module. So far I have only used its functionality for one of my albums and to export the kml-file to Google Earth. The result is amazing and impressed all my friends!!! (beside the fact that my graphic card crashed).

It's a pitty that no one takes care of this module anymore and there are not many threads in the forums, to learn more about this great feature. I know you were one of the early adopters of this module and therefore I'm more than happy that you support me, a dummy!

My final intention is to capture such a Google Earth trip and integrate it in my video editing program (a beta test was already successful), but for this I realized that I will need a newer generation graphics card anyhow ;-)

rgds/oceco

 
oceco

Joined: 2007-10-22
Posts: 666
Posted: Thu, 2008-01-17 23:14

@siliconFiend

meanwhile I integrated your suggestion in my template and it works as expected! GREAT! For me, it proves that what I've tried to explain to steph33560 was correct. And I believe you confirmed this with your contribution above somehow.

Quote:
You can experiment with its placement.

I did it. And further experiments will follow, for sure! And I'm sure further questions as well will arise because my imaginations / ideas are endless ;-)

But I also believe, this great module deserves it, also for an overall demonstration of the Gallery2 advanced capabilities.

A very special thank also goes to Termitenshort who made the basics of this great module. His only fault was probably that his contribution of this module was to early and therefore most people didn't recognize its value. Sincerely i hope to have him back in here somewhere!

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Fri, 2008-01-18 00:01
oceco wrote:
It's a pitty that no one takes care of this module anymore and there are not many threads in the forums, to learn more about this great feature.

Oh, you hurt my feelings! :-) I'm maintaining the map module now. And if you look through this forum, you'll see lots of map module threads. Termitenshort pops in periodically, but I have SVN commit access and can release versions. The map theme has not been maintained, though.

I wrote the code for the Mini Map block that you are now using in your header. I also (re)wrote the Google Earth export. Note that it will export your gallery album structure rooted from whichever album you're at when you select the "View in Google Earth" link. So, if you want to see your entire gallery, click the link in your root album.

By the way, you shouldn't need to do anything to hide the block if the photo or album you're viewing has no coordinates. The Mini Map block already does that. You might look at some of the options, though, to customize what's shown (i.e., use the parent album coordinates if the item doesn't have its own). Look at the blocks.inc file in modules/map/templates/blocks for explanation of the options. By the way, you can just go to the Theme Admin page and add the Mini Map block to a photo or album page if you want. You might not be able to get it in the header, though, depending on the theme you're using.

 
oceco

Joined: 2007-10-22
Posts: 666
Posted: Fri, 2008-01-18 14:37

I'm sorry that I hurt you! Was not my intention.

It was just my impression because in the old forum one could see the progress or development of this module. Since this forum is closed its hard to track what's going on.

I integrated your block in my template and it worked well. But I couldn't check anymore if it's not there if there are no geotaged items, because the notification module crashed my gallery! And I have no idea how to bring it alive again.

Nevertheless THANK YOU for this great block!!!

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Fri, 2008-01-18 20:28

You didn't really hurt my feelings. It's true that development has slowed significantly on this module. It needs a ground-up restructuring before we can add really cool features. It's a really big task, and I don't know when I'll have time to do it. I'm planning to start soon, but the downside is that the users won't really notice much difference for all the work I need to put into it. Ah, well.