Google Maps + Gallery

Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Fri, 2005-10-21 15:18

Also, the legend thing is a good idea I was about to develop that for my map :-)

This will be the very next thing right after the MapControl theme thing is implemented :)

------------------
The Termite :-)

 
TheGoOse
TheGoOse's picture

Joined: 2002-12-31
Posts: 50
Posted: Fri, 2005-10-21 18:01
Termitenshort wrote:
2- for the marker that says BLUE and is RED .. I have not a single clue what happened there !!! I guess something went south with ImageMagick. TheGoOse Can you please look if the other markers got their color changed ?

Weird... markers are just red, black or grey. Maybe you're right and ImageMagick's the problem. Would it help if I try changing to GD by default, and recreating the markers?

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Fri, 2005-10-21 21:36

Well it wouldn't help because I'm using the "convert" utility (part of imagemagick) like the code I got originally from xxx (I don't remember who)

-> this also means by the way that if ImageMagick isn't installed it doesn't work at all :-(

Otherwise I got the "Action" button to work, I just need to find a way to distribute it in a clean way.

We'll see....

----------------------
The Termite :-)

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sat, 2005-10-22 00:11
dogdog wrote:
Hi Termitenshort,

Thanks for your reply. I have installed imagemagick and worked fine in my gallery. I also found that in the map, it can show the "shadow" of the marker and when I click the "shadow" , the album can appear! Now just dono why can't shown the "real" image of the marker! Sorry for disturb your time again!

Dogdog

My apologies for not answering I just saw your message burried in many others !! :-)

You seem to have a problem with the way your gallery is installed compared to my test environements :(

Can you tell me what is your install path ? (/gallery2/ or /gallery/ or ...)

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sat, 2005-10-22 00:17

New Module version beta6

What's changed:
- AutoPopulate the GPS field by cliking on a google map opened on a new window
- Fixed problems with GxMagnifier
- Add the "ZoomLevel" field to give ability to select a zoom per foto (thx ThegoOse)
- put a "go back to the map" link on pictures and albums

There is more and more references to folders so I will be looking into making it "folder independant". I have my installs made on /gallery2/ of my webservers, if you have the same you should see no problems.

If you have anything else let me know you will be good candidate for testing. So far I have:
- swordfish: uses embedded WordPress
- shocksll: uses embedded Mambo
- makro: uses joomla/mambo
- TheGoOse: have an install in /gallery/

I hope you can help me figuring out what exactly is wrong with the path deal, like I said I have be doing some research on the embedded mode but I'm done quite done yet :)

I want to stop adding new features until I figure it out all. I'd like to make this module not beta anymore ... :D

EDIT: hopefully fixed all the problems with the path problems and such ...

Let me know !

--------------------
The Termite :-)

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Sat, 2005-10-22 02:50

Termite,
Tried Beta6 by upgrading, then upon activating I got the below errors. Maybe I should have deactivated first.?

Warning: mkdir(/var/www/localhost/htdocs/gallery2/themes/CVS/templates/local/): No such file or directory in /var/www/localhost/htdocs/gallery2/modules/map/module.inc on line 116

Warning: copy(/var/www/localhost/htdocs/gallery2/themes/CVS/templates/local/album.tpl): failed to open stream: No such file or directory in /var/www/localhost/htdocs/gallery2/modules/map/module.inc on line 119

Warning: copy(/var/www/localhost/htdocs/gallery2/themes/CVS/templates/local/photo.tpl): failed to open stream: No such file or directory in /var/www/localhost/htdocs/gallery2/modules/map/module.inc on line 120

Warning: mkdir(/var/www/localhost/htdocs/gallery2/themes/custom/templates/local/): No such file or directory in /var/www/localhost/htdocs/gallery2/modules/map/module.inc on line 116

Warning: copy(/var/www/localhost/htdocs/gallery2/themes/custom/templates/local/album.tpl): failed to open stream: No such file or directory in /var/www/localhost/htdocs/gallery2/modules/map/module.inc on line 119

Warning: copy(/var/www/localhost/htdocs/gallery2/themes/custom/templates/local/photo.tpl): failed to open stream: No such file or directory in /var/www/localhost/htdocs/gallery2/modules/map/module.inc on line 120

Warning: mkdir(/var/www/localhost/htdocs/gallery2/themes/greymatter/templates/local/): No such file or directory in /var/www/localhost/htdocs/gallery2/modules/map/module.inc on line 116

Warning: copy(/var/www/localhost/htdocs/gallery2/themes/greymatter/templates/local/album.tpl): failed to open stream: No such file or directory in /var/www/localhost/htdocs/gallery2/modules/map/module.inc on line 119

Warning: copy(/var/www/localhost/htdocs/gallery2/themes/greymatter/templates/local/photo.tpl): failed to open stream: No such file or directory in /var/www/localhost/htdocs/gallery2/modules/map/module.inc on line 120

Warning: Cannot modify header information - headers already sent by (output started at /var/www/localhost/htdocs/gallery2/modules/map/module.inc:116) in /var/www/localhost/htdocs/gallery2/modules/core/classes/GalleryPhpVm.class on line 124

EDIT:
I then accessed via G2 standalone and it showed as beta6 and already activated. Configuration, Theme tabs and all worked and I could still display map in embedded mode.
** The good news is that after this little glitch I returned to the map admin interface in embedded mode and everything appeared all working for the first time :-).
Also, I did not have to edit any files and I don't seem to be getting any errors in my Apache log file anymore!
Lookin' Good!

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2005-10-22 03:37

I just tried beta 6 as well and got this error

Quote:
Warning: Invalid argument supplied for foreach() in /home/.carl/website/gallery2/modules/core/Callbacks.inc on line 62

Un- installing the module does not fix so.... starting agian. I don't think it is related to the module but "you never know".

Trying to figure out how to make a dropdown for the different navigation themes but I was unable to see how the "frames" work. Oh well, I will start agian.

Dave

____________________________________________________
Gallery Frames / Mods || G1 Test Gallery

 
makro
makro's picture

Joined: 2005-10-10
Posts: 12
Posted: Sat, 2005-10-22 08:32

Termitenshort, thx for your great effort!

btw, i am using g2 (2.0.1) embedded (4theweb-Bridge 2.09) in Joomla (1.0.3) and my gallery path is g2/

I just installed beta6 and the GxMagnifier is working fine, but still no marker. Nice that now it's all the same for accessing the map standalone or embedded (fixed path-problem, i think)

Strange that when the map loads i see just the shadows of the markers for a little moment, but then they are disappeared.

As for ImageMagick, i am using a shared hosting solution and my provider don't offer ImageMagick (only NetPBM and GD), but i don't get any errors when i create a set of markers in your Theme-Tab (what i have to, otherwise i am not able to load the map). So maybe my marker-problem is caused by this (as mentioned before i think), sad :(

Another little suggestion for embedded users: i am testing different inclusions of GoogleMaps into Jommla, and all have the ability to set the width either to fixed (pixel) or relative (percent), what is in embedded mode quite mandatory for the layout. It would be really nice to have this option in your module too.

Quote:
I want to stop adding new features until I figure it out all.

Very good idea!! Otherwise it will be going just to confusing for everyone.

 
makro
makro's picture

Joined: 2005-10-10
Posts: 12
Posted: Sat, 2005-10-22 09:15

Does anyone know how to get rid of this ugly movement cursors in the map? (see attachment)
I only want to use the GxMagnifier instead.

 
djrm2
djrm2's picture

Joined: 2005-10-04
Posts: 54
Posted: Sat, 2005-10-22 15:11

Greetings everybody,
I have been silently following this thread with great interest recenteley watching the map module development and trying various betas.

I had a problem on my site with mapmodule3beta6/ShowMap.inc To correct it I had to change the following line 48 from
$template->javascript('/GxMagnifier.1.js');
to
$template->javascript('modules/map/magnifier/GxMagnifier.1.js');
Prior to doing this the pushpins and magnifier icon did not show, the clue to the problem was given in my apache2 error log.

I too do not get the pushpins created with the correct colours.

When upgrading I get a lot of warning messages from mkdir and copy but a screen refresh shows the activation to have occured. Something similar happens when the module is un-installed too.

I have not seen and/or cannot figure how to use the AutoPopulate feature, Can anybody help me there please?
The back to map link seems like a good idea.

A big thankyou to everyone involved in writing and testing this module.

Regards, Dave.

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sat, 2005-10-22 15:16

Hello all :D

I guess I've created more problems again ....

swordfish: your problem is not critical to the install so I will put an erro checking there so no more error will show up. The good thing is that embedded mode finally works !!

floridave: i'm not sure what this is ... what were you doing when the rror striked ? I need to reproduce it to fix it.
As for the dropdown I know how to do that if you need help just let me know ;)

makro: Yes your marker problem is definitively related to fact that the ISP doesn't have imagemakick...
A temporary solution (until I figure out a way to add other toolkits) is to setup easyphp on a windows desktop and put gallery+map-module+imagemagick.
By doing this you will be able to create the marker sets on windows and then you can just upload the folders (in /gallery2/images/map/) to your ISP in the same spot.
it should allow you to use the module.
I guess the weird thing is that the module actually verify that files are created successfully and if not generate an unknown error. Can you verify if any files are located in the "gallery2/images/map/xxx" folders ?

To get rid of the movement cursor, open the "ShowMap.tpl" file and remove the lines

            {if $map.showZoomScale}
                map.addControl(new GLargeMapControl());
            {else}
                map.addControl(new GSmallMapControl());
            {/if}

No map control will show up after that.

I guess it is safe to say that this module has better success in terms of path control :-) Maybe we will have a winner soon !

-------------------------------
The Termite :-)

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sat, 2005-10-22 15:29
makro wrote:
Another little suggestion for embedded users: i am testing different inclusions of GoogleMaps into Jommla, and all have the ability to set the width either to fixed (pixel) or relative (percent), what is in embedded mode quite mandatory for the layout. It would be really nice to have this option in your module too.

Currently the map module gives the ability to set a fixed size, adding the possibility to use a % is very easy, i will be doing that when this module stops having funny problems :) It seems I've added too much things :) :) :)

Anyway, update module to correct the "activation" problems

EDIT: re-upload to reflect the beta7 version ....

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sat, 2005-10-22 15:33
djrm2 wrote:
Greetings everybody,
I have been silently following this thread with great interest recenteley watching the map module development and trying various betas.

I had a problem on my site with mapmodule3beta6/ShowMap.inc To correct it I had to change the following line 48 from
$template->javascript('/GxMagnifier.1.js');
to
$template->javascript('modules/map/magnifier/GxMagnifier.1.js');
Prior to doing this the pushpins and magnifier icon did not show, the clue to the problem was given in my apache2 error log.

I too do not get the pushpins created with the correct colours.

When upgrading I get a lot of warning messages from mkdir and copy but a screen refresh shows the activation to have occured. Something similar happens when the module is un-installed too.

I have not seen and/or cannot figure how to use the AutoPopulate feature, Can anybody help me there please?
The back to map link seems like a good idea.

A big thankyou to everyone involved in writing and testing this module.

Regards, Dave.

With beta6 you shouldn't have to modify header.tpl to point to the right spot for GxMagnifier. In fact, the module (when activated) copies the file to the root of the webserver where it's meant to be (by design from the author).

beta7 should fix all problems related to activation/deactivation errors :)

See you

 
djrm2
djrm2's picture

Joined: 2005-10-04
Posts: 54
Posted: Sat, 2005-10-22 15:42

Termite, thanks for the info. It must be that the copying procedure did not work properly on my system.
Perhaps since gallery2 is not in a subfolder of my main webspace (/var/www) but under /usr/share .
Ill watch out next time I activate it and see what happens.
Please describe the autopopulate feature some more.
Thanks again, Dave.

 
makro
makro's picture

Joined: 2005-10-10
Posts: 12
Posted: Sat, 2005-10-22 15:59

Termitenshort, at the moment i don't dare activating your module anymore,
because sthg really strange is happening with the gallery then (can tell only for beta6):

after installing and activating beta6 all my album.tpl files under gallery/templates in
the local-folders where gone!??? It took my a while to figure out why all the templates
where behaving strange, and after deactivating your module i had to reconstruct all changes
i made in all templates before.

After your last message here i activated it again, and again all album.tpl files where gone,
so it must be caused by your module, or not? I am really confused now...

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sat, 2005-10-22 16:03
djrm2 wrote:
Termite, thanks for the info. It must be that the copying procedure did not work properly on my system.
Perhaps since gallery2 is not in a subfolder of my main webspace (/var/www) but under /usr/share .
Ill watch out next time I activate it and see what happens.
Please describe the autopopulate feature some more.
Thanks again, Dave.

The autopopulate field is located (if everything is fine) under the customfiled of an item, right next to the GPS field there is a link "Get via Map" it should spawn a new map where you can select your coordinate.

See you !

 
makro
makro's picture

Joined: 2005-10-10
Posts: 12
Posted: Sat, 2005-10-22 16:06
Termitenshort wrote:
and then you can just upload the folders (in /gallery2/images/map/) to your ISP in the same spot.

Thanks for the hint, i did quite the same already. Just created a markerset eg orange and uploaded manually a marker_orange.png to gallery2/images/map/orange/ - and yes, this directory was created by your module, and inside there was a file called colorlist with the selected colorname inside.

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sat, 2005-10-22 16:22
makro wrote:
Quote:
and then you can just upload the folders (in /gallery2/images/map/) to your ISP in the same spot.

Thanks for the hint, i did quite the same already. Just created a markerset eg orange and uploaded manually a marker_orange.png to gallery2/images/map/orange/ - and yes, this directory was created by your module, and inside there was a file called colorlist with the selected colorname inside.

This makes total sense then, I need to add some validation to check if ImageMagick is present or not .....

I will do that later today :)

 
TheGoOse
TheGoOse's picture

Joined: 2002-12-31
Posts: 50
Posted: Sat, 2005-10-22 16:24

I've tried latest beta and everything works fine in my /gallery/ folder, although my blue markers are still red ;)

 
samkuhn2

Joined: 2004-04-13
Posts: 60
Posted: Sat, 2005-10-22 16:28

It is probably possible to at least allow the color changing ability of the module to be used with GD:
http://www.conexim.info/content/php/function.imagefilter.html
IMG_FILTER_COLORIZE: Like IMG_FILTER_GRAYSCALE, except you can specify the color. Use arg1, arg2 and arg3 in the form of red, blue, green. The range for each color is 0 to 255.

 
samkuhn2

Joined: 2004-04-13
Posts: 60
Posted: Sat, 2005-10-22 16:33

Similarly, Netpbm allows hue change:
http://netpbm.sourceforge.net/doc/ppmbrighten.html
http://netpbm.sourceforge.net/doc/pnmremap.html
http://netpbm.sourceforge.net/doc/ppmchange.html

although it wasnt' clear if it is as straightforward as with GD or Imagemagick.

I have not yet looked into the exact commands that would be necessary to do text/symbol overlay or to autogenerate shadows.

 
makro
makro's picture

Joined: 2005-10-10
Posts: 12
Posted: Sat, 2005-10-22 16:45

Termitenshort: beta7 is still deleting every album.tpl file in every
subfolder of /gallery/templates/
this is a really annoying behaviour, because before everything was sitting
peacefully next to each other inside the gallery :(

 
djrm2
djrm2's picture

Joined: 2005-10-04
Posts: 54
Posted: Sat, 2005-10-22 17:43

Termite, thanks for the info. A couple of things have stopped the CutomFieldItemEdit.tpl from working.
1) the file never got copied into modules/customfield/templates/local (the instaler tried to put it into Local
2) after placing the file manually into local I then had to edit it at line 29 by adding the following:
<input type="text" size="40"
name="{g->formVar var="form[fields][$field]"}" value="{$value}"/>
(above lines copied from a bit further down after else)
There seems to be something wrong with my install but the above has fixed it and the 'get via map' now works.

n.b. Imagemagic 6.0.6.2-2.4 is installed and everything else which uses seems to work apart from the pushpin colouring.
convert is also V6.0.6, it appears to be a current version with nothing later available.

Dave.

edit: Perhaps it is not clear in the note above. The install script uses the directory 'Local' i.e. upper case L, I made the function work by putting the edited file into 'local' i.e. lower case l.

hth Dave.

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Sat, 2005-10-22 18:59

After reading all these comments since last night I went back and checked my map module install (Beta6).
1. Similar to Makro's issue, I see the photo.tpl and album.tpl are being copied to each /gallery2/themes/theme_name/templates/local directory. This is probably a bad idea because if a user already has customized photo.tpl and album.tpl in the 'local' dir (like I do) then the map-module overwrites them! Must be a better solution or at least warn that these files will be replaced.

2. Similar to djrm issue, for me the CustomFieldItemEdit.tpl did get copied into
modules/customfield/templates/local but I'm not seeing any 'Get via a Map link'. I'm not understanding how djrm modified this file because the code

<input type="text" size="40"
name="{g->formVar var="form[fields][$field]"}" value="{$value}"/>

is present on line 33.

EDIT: I now see what djrm did for it work however, this change still does not work for me. Hmmm....

Termite
Since this module is growing in number of files could you perhaps specify where these files should reside.? Putting the file locations in README would suffice.

Thanks!

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sat, 2005-10-22 22:10
makro wrote:
Termitenshort: beta7 is still deleting every album.tpl file in every
subfolder of /gallery/templates/
this is a really annoying behaviour, because before everything was sitting
peacefully next to each other inside the gallery :(

Well there isn't a delete for /gallery/templates/ so I'm assuming you are talking about the file in the theme folders, this is the only way that I know at this point to get the "back to the map" link.

It's actually just creating an album.tpl and photo.tpl in a "local" folder under each theme to override the default so that a link is displayed for photos and album comming from the map.

I'm not sure there is another way to do that at this point.

THe delete only happens when the module in deactivated and it only deletes file previously added...

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sat, 2005-10-22 22:20
djrm2 wrote:
Termite, thanks for the info. A couple of things have stopped the CutomFieldItemEdit.tpl from working.
1) the file never got copied into modules/customfield/templates/local (the instaler tried to put it into Local

I see... didn't think about that :-)

djrm2 wrote:
2) after placing the file manually into local I then had to edit it at line 29 by adding the following:
<input type="text" size="40"
name="{g->formVar var="form[fields][$field]"}" value="{$value}"/>
(above lines copied from a bit further down after else)
There seems to be something wrong with my install but the above has fixed it and the 'get via map' now works.

the only thing changed from my original CustomEditItem.tpl is that I added:

       {if ($field eq 'GPS')}
        <a href="{g->url arg1="view=map.GPSMap" arg2="itemId=`$form.itemId`"}">Get via a Map</a>
       {/if}

Right after the "input" displayed .... I'm not sure why you would have to modify it at all, it's just adding a link next to the input field if it is GPS and nothing else

djrm2 wrote:
n.b. Imagemagic 6.0.6.2-2.4 is installed and everything else which uses seems to work apart from the pushpin colouring.
convert is also V6.0.6, it appears to be a current version with nothing later available.

Dave.

I'm currently using Version: ImageMagick 6.2.2 05/26/05 Q16 on all my linux boxes and mageMagick 6.2.5 Q8 on both my windows boxes. Maybe something has changed in the way ImageMagic convert colors.... something to try i guess.

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sat, 2005-10-22 22:26
swordfish wrote:
After reading all these comments since last night I went back and checked my map module install (Beta6).
1. Similar to Makro's issue, I see the photo.tpl and album.tpl are being copied to each /gallery2/themes/theme_name/templates/local directory. This is probably a bad idea because if a user already has customized photo.tpl and album.tpl in the 'local' dir (like I do) then the map-module overwrites them! Must be a better solution or at least warn that these files will be replaced.

Totally agreed, do you have something else to propose ?
I'm trying to find a way to have the file (in the local directory if it exists) edited but I have a feeling this could be worse ... (it's not hard to do but with all the possibility of what the file can be, it can be a bit cumbersome to implement.
Also another possibility would be to prevent overwriting and then display a message for all files not copied...

swordfish wrote:
2. Similar to djrm issue, for me the CustomFieldItemEdit.tpl did get copied into
modules/customfield/templates/local but I'm not seeing any 'Get via a Map link'. I'm not understanding how djrm modified this file because the code

<input type="text" size="40"
name="{g->formVar var="form[fields][$field]"}" value="{$value}"/>

is present on line 33.

EDIT: I now see what djrm did for it work however, this change still does not work for me. Hmmm....

I said right above what exactly is needed for the link to display, when the template goes through the field to display there is a condition that if the field is called "GPS", it adds a link next to it. I'm not sure why it doesn't display it

swordfish wrote:
Termite
Since this module is growing in number of files could you perhaps specify where these files should reside.? Putting the file locations in README would suffice.
Thanks!

Will be doing that now.

See you !

--------------------
The Termite :-)

 
djrm2
djrm2's picture

Joined: 2005-10-04
Posts: 54
Posted: Sat, 2005-10-22 22:33

Whilst trying to make the map module work I discovered the following:

You need to initially copy the distributed files to
gallery2/modules/map

Some other files are copied automatically when the module is activated:

gallery2/modules/customfield/templates/local/CustomFieldEdit.tpl

The following are copied into the matrix theme and all themes too:
gallery2/themes/matrix/templates/local/album.tpl
gallery2/themes/matrix/templates/local/photo.tpl

The following are copied when module is activated:
webroot /magnify.png
webroot /spacer.png
webroot /GxMagnifier.1.js

The following are created when new pushpins are created
gallery2/images/map/<name>/colorlist
gallery2/images/map/<name>/marker_<colour>.png
where <name> is the name you give the set
and <color> is the colour of the pushpin

edit: images/map path corrected
edit: Local changed to local in line with V.03

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sat, 2005-10-22 22:33

To conclude with the latest comments:

- The Album.tpl and photo.tpl in each theme "local" folder gets replaced if it already exists and that is to add the link "back to the map"
-> questions:
Should I remove this feature for now ?
Should I work on a way to modify the file if they exists instead of overwritting them ?
Should I simply prevent overwriting to the risk that the link won't be there ?

- There is some issues with CustomFieldItemEdit.tpl but at this point i'm not too sure what are the reasons, it's pretty straight forward.

- ImageMagick needs to be a certain version as it seems, which version do you all use and does it work correctly ?

- Path issues have been resolved with or without embedded mode

- There is definitively a BIG need for more comments, so I'll be working on it :)

I hope pretty much summarize the current situation and sorry any inconvenience with the latest changes :$

---------------------
The Termite :-)

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sat, 2005-10-22 22:35
djrm2 wrote:
Whilst trying to make the map module work I discovered the following:

You need to initiall copy the distributed files
gallery2/modules/map (distributed files)

Some other files are copied automatically when the module is activated:

gallery2/modules/customfield/templates/Local/CustomFieldEdit.tpl
(I think that Local here should be local)

I just changed that to "local"

djrm2 wrote:
The following are created when new pushpins are created
gallery2/<name>/colorlist
gallery2/<name>/marker_<colour>.png
where <name> is the name you give the set
and <color> is the coulour of the pushpin

Actually created under /gallery2/images/map/<name>/* but yes that's correct :-)

 
djrm2
djrm2's picture

Joined: 2005-10-04
Posts: 54
Posted: Sat, 2005-10-22 22:56

If you are trying to use the 'Get via a Map link' feature in a limited area then a quick edit of gallery2/modules/map/template/GPSMap.tpl allows the initial map to be localised to suit your needs.
I put these values in for an itial map of the whole of the UK.

{* line 14 <div id="map" class="gbBlock" style="width: 400px; height: 300px; color:black;"> djrm *}
<div id="map" class="gbBlock" style="width: 600px; height: 600px; color:black;">

{* line 22 map.centerAndZoom(new GPoint(-12,20),16); djrm *}
map.centerAndZoom(new GPoint(-1,54),12);

From time to time when I click on the 'zoom in' link in the pushpin thumbnail view then the location shown in the zoomed in map is quite wrong,
the location shown actually belongs to another pushpin. Has anyone else seen this strange behaviour?
I think this could be a cache issue but I really dont know.

 
makro
makro's picture

Joined: 2005-10-10
Posts: 12
Posted: Sat, 2005-10-22 23:16
Termitenshort wrote:
Should I remove this feature for now ?
Should I work on a way to modify the file if they exists instead of overwritting them ?
Should I simply prevent overwriting to the risk that the link won't be there ?

Until there is no satisfiying solution found, i would definetely disable this feature.
Look, this idea behind the local-folders is really a good one. If any other program/module is editing
or overwriting settings a user has made, and that without letting him know, that is just disregarding the
whole idea behind the local-folders.

The back-to-the-map function is a very nice one, and people here are no beginners, why just not tell
them where to put that piece of code to turn it on by themselves?

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Sun, 2005-10-23 00:28

Yep, changing 'Local' to 'local' did the trick. Didn't even realize the capital 'L'.
Now, when clicking on the 'Get via a Map' link I get the dreaded IE operation aborted error.
Believe this is due to my embedded G2 so should be a simple fix for me to take care of.

As to the back-to-the-map feature (which is great!) I'd recommend removing it and as you said above
folks can just add the code if they want it. However, if this module will one day be part of the
official G2 then obviously a clean working solution will have to be devised.

djrm2,
Yes, I have noticed this strange behavior when zooming-in and it's been driving me nuts.
I think it may be a caching issue but I've cleared the template cache. Seems it corrects
itself after launching a new browser window. I think it's a browser caching issue. For me this
usually happens after I update a coordinate for an image or album.

 
TheGoOse
TheGoOse's picture

Joined: 2002-12-31
Posts: 50
Posted: Sun, 2005-10-23 00:36

I don't think that's the moment for that, but... if you manage to make 'Get back to the map' work for everybody, it would be great if you passed the object number as a parameter, so it's automatically highlighted in the map :)

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Sun, 2005-10-23 05:44

Termite,
For the back-to-the-map feature perhaps one solution is to simply display the code (with summary instructions) on the map-module Themes tab instead of copying the .tpl files to the theme local dir. A good example of what I mean is take a look in the Admin interface under the Image Block module. The code snippets for External Image Block.

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sun, 2005-10-23 06:15
TheGoOse wrote:
I don't think that's the moment for that, but... if you manage to make 'Get back to the map' work for everybody, it would be great if you passed the object number as a parameter, so it's automatically highlighted in the map :)

That's easy enought to do but I guess for the time being I will be removing this feature.
I'm thinking of another idea to get this solved. I might have found a solution but I will investigate it some more tomorrow.

for now, here is the module whitout that feature which should work fine everybody :-)

I got rid of the beta status and I also added some comment in the README. I'll be working on commenting the code.

BEWARE also that I have change the Map Control feature to enable for the choice between small/large/none, by default it should display Small ...

EDIT: Tiny bug found nothing alarming (just had a wrong file in the archive), I re-uploaded the module

EDIT2: I have re-uploaded another one further down with some bug fixes and correction for the GxMagnifier tool

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sun, 2005-10-23 06:17
swordfish wrote:
Termite,
For the back-to-the-map feature perhaps one solution is to simply display the code (with summary instructions) on the map-module Themes tab instead of copying the .tpl files to the theme local dir. A good example of what I mean is take a look in the Admin interface under the Image Block module. The code snippets for External Image Block.

This is a great way to get this working for the time being !! thx for the idea :)

I'll be adding that first thing tomorrow until I finish with my new solution

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Sun, 2005-10-23 07:22

Just FYI, I'm using ImageMagick v6.2.2.3 on Linux and all color markers are good to go.

 
djrm2
djrm2's picture

Joined: 2005-10-04
Posts: 54
Posted: Sun, 2005-10-23 09:38

I got these errors when activating the map module:
Warning: copy(/usr/share/gallery2/../spacer.png): failed to open stream: Permission denied in /usr/share/gallery2/modules/map/module.inc on line 106
Warning: copy(/usr/share/gallery2/../magnify.png): failed to open stream: Permission denied in /usr/share/gallery2/modules/map/module.inc on line 107
Warning: copy(/usr/share/gallery2/../GxMagnifier.1.js): failed to open stream: Permission denied in /usr/share/gallery2/modules/map/module.inc on line 108

My gallery2 is not in the root of my webspace but in /usr/share an apache2 directive allows it to work from there.
Consequentley the map installer lines of the form $basegallerydir."../GxMagnifier.1.js" are doomed to fail as there is no write permission to this directory.
And even if there was the files would not be accessable from the internet (I hope :-) )
So I have had to manually add GxMagnifier.1.js, magnify.png, and spacer.png to the root of my webspace (/var/www)

In addition to the above I had to put the absolute file path to the root of my webspace to make GxMagnifier work
Changes to file modules/map/ShowMap.inc
if (file_exists('/var/www/GxMagnifier.1.js')) $template->javascript('/GxMagnifier.1.js'); // djrm, line 50
if (!file_exists('/var/www/GxMagnifier.1.js')) $map['errorgxmagnifier']=1; // djrm, line 180
I did not see what was wrong with gxmagnifier in the modules/map directory,
I dont really want the script trying to copy files into the root of my webspace anyway.

The modification which I found neccessary to modules/customfield/templates/local/CustomFieldItemEdit.tpl is no longer needed.
Dont ask me why but I expect there was a problem with the form choices field.

Anyway, the map module is now working again.

I think I reported the version of imagemagick convert incorrecteley, on my Debian GNU Linux it is:
ImageMagick 6.0.6 05/26/05 Q16
I'll have a poke arround and try and get the commands work at the console.

As well as standalone Gallery2 I also have it embedded into Drupal, The display map function works embedded in drupal but
clicking on the 'zoom in' line causes a mal formed request and the gallery is lost and just a drupal page is displayed.
I dont know why.

I am quite happy with the module trying to write into the local module directories, it fails anyway. ;-)
However it is not a good idea for production code, though I have left the mods in place for now.

Nice work
Regards, Dave

 
TheGoOse
TheGoOse's picture

Joined: 2002-12-31
Posts: 50
Posted: Sun, 2005-10-23 09:39

I've just upgraded to last version. When trying to recreate markers, i've got that error:

Quote:
Warning: getimagesize(/gallery/modules/map/basemarkers/marker.png): failed to open stream: No existe el fichero o el directorio in /web/htdocs/www.ganso.org/home/gallery/modules/map/MapSiteAdmin.inc on line 389

In the /images/map/[markername]/ folder, there is just the colorlist file.

I've cheched that /gallery/modules/map/basemarkers/marker.png really exists. Looks like my ISP has some kind of problem with the ImageMagick library?

 
djrm2
djrm2's picture

Joined: 2005-10-04
Posts: 54
Posted: Sun, 2005-10-23 11:30

These thee additional lines in modules/map/MapSiteAdmin.inc lines 223 to 225 have broken the marker generation for me, removing them made it work again.
$urlGenerator =& $gallery->getUrlGenerator();
$urlComponents = parse_url($urlGenerator->getCurrentUrlDir(true));
$base = $urlComponents['path'];

For some reason I need to have both Man.png and man.png in modules/map/basemarkers,
With man.png added I can create new markers, how strange is that!

However even when working I am still not getting the correct colours.

I think the command in use is something like this:
convert -modulate 95,127,159
/usr/share/gallery2/modules/map/basemarkers/marker.png /usr/share/gallery2/images/map/Drop/marker_GREEN.png
but even at the command line this fails to generate correct colours
Looking in the inkernet there seems to be some confusion about the later versions of the convert command but I have not yet found a solution.

The parameters for -modulate are brightness, saturation, and hue
Whatever values I put in for hue seems to have no effect, hence the varying shades of red in the resulting images.

edit, making the hue values much larger (x10) makes the markers all have different colours.
I do not yet know what numbers are needed.

edit, there is something really strange, if I find some hue numbers which work on the command line
they give different results when put into the module. Anyway numbers in the region of a few thousand give results

edit, I have just tried convert on another Debian Linux system (Knoppix 4.0.2) and get the same results as above.

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sun, 2005-10-23 14:41
TheGoOse wrote:
I've just upgraded to last version. When trying to recreate markers, i've got that error:

Quote:
Warning: getimagesize(/gallery/modules/map/basemarkers/marker.png): failed to open stream: No existe el fichero o el directorio in /web/htdocs/www.ganso.org/home/gallery/modules/map/MapSiteAdmin.inc on line 389

In the /images/map/[markername]/ folder, there is just the colorlist file.

I've cheched that /gallery/modules/map/basemarkers/marker.png really exists. Looks like my ISP has some kind of problem with the ImageMagick library?

That's because I forgot a line with the absolute path ... it should be getimagesize(/web/htdocs/www.ganso.org/home/gallery/modules/map/basemarkers/marker.png).

The line 389 should be:
{code]
$currentsize = getimagesize($basegallerydir."modules/map/basemarkers/".$basemarkername.".png");
[/code]

It's most likely the reason for the marker to fail to be created.

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sun, 2005-10-23 14:52
djrm2 wrote:
My gallery2 is not in the root of my webspace but in /usr/share an apache2 directive allows it to work from there.
Consequentley the map installer lines of the form $basegallerydir."../GxMagnifier.1.js" are doomed to fail as there is no write permission to this directory.
And even if there was the files would not be accessable from the internet (I hope :-) )
So I have had to manually add GxMagnifier.1.js, magnify.png, and spacer.png to the root of my webspace (/var/www)

Yes that's the solution.
I need to find a way to get the "current directory" in javascript and change the GxMagnifier script for it to be able to reside in the module directory. The authot made it so that it needs to be located at the root of the webserver. My other attemps to change that failed so far :-(

djrm2 wrote:
In addition to the above I had to put the absolute file path to the root of my webspace to make GxMagnifier work
Changes to file modules/map/ShowMap.inc
if (file_exists('/var/www/GxMagnifier.1.js')) $template->javascript('/GxMagnifier.1.js'); // djrm, line 50
if (!file_exists('/var/www/GxMagnifier.1.js')) $map['errorgxmagnifier']=1; // djrm, line 180

Yep, that would be needed after that :-D

djrm2 wrote:
I think I reported the version of imagemagick convert incorrecteley, on my Debian GNU Linux it is:
ImageMagick 6.0.6 05/26/05 Q16
I'll have a poke arround and try and get the commands work at the console.

It seems that 6.2 is a minimum, to create a marker from the base here is the code:

convert -modulate 95,95,31 - resize 12x20 basemarker targetmarker

This creates a BLUE marker from the "red" one it also resize it to 12x20. It's pretty stright forward but I guess I should be putting a condition on the version when I find the minimum required version

djrm2 wrote:
I am quite happy with the module trying to write into the local module directories, it fails anyway. ;-)
However it is not a good idea for production code, though I have left the mods in place for now.

This is the same as for the "back to the map link" it's a usefull feature but to implement it the customfielditemedit.tpl file has to be changed ... there isn't another way for now.

See you :):):)

-----------------------
The Termite :)

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sun, 2005-10-23 15:30

djrm2, can you please tell me what is the URL that the module directory is at ?

For me, the module directory would be:
http://host/gallery2/modules/map/ ...

I'm trying to figure out a way to get this location so that the javascript can be pointed to the location of the spacer.png and magnifier.png and I wouldn't have to copy those files to the root of the webserver

------------------------
The Termite :-)

 
djrm2
djrm2's picture

Joined: 2005-10-04
Posts: 54
Posted: Sun, 2005-10-23 15:50

There is a problem when clicking on the 'zoom in' link on the image preview obtained by clicking on the marker.
What happens is that the zoom in goes to the wrong place on the map.
The problem is different depending upon wether ie or Firefox is used.
With ie the problem can be worked arround by first double clicking on the marker, this centres the map on the marker.
The single click to open the preview and then click on the zoom in link.
Using firefox the double click does not centre the map so there is not a workarround.
What seems to happen is that zoom in goes to the centre of the map, not some other image as I first thought.

Termite, I tried your mod to line 389 of MapSiteAdmin.inc it seems to make no difference to me.
I still need to disable the lines I mentioned above, I think my problem was something else.

A funny thing is happening. Whatever size I choose for the markers they always appear the same size on the map.
The marker images are being generated with the correct sizes but they always render the same size regardless.

 
djrm2
djrm2's picture

Joined: 2005-10-04
Posts: 54
Posted: Sun, 2005-10-23 16:02

from the outside it is http://host/gallery2/modules/map/ ...
but internally it is /usr/share/gallery2/modules/map/...
but web root is at /var/www/... (thats where I had to put the 3 files)
GXMagnifier worked fine from /gallery2/modules/map/.. when I had it there by mistake

edit: I have just tried this again but it seems that the .png fileS do need to be in the web root (but not the javascript)

 
TheGoOse
TheGoOse's picture

Joined: 2002-12-31
Posts: 50
Posted: Sun, 2005-10-23 16:52
Termitenshort wrote:
That's because I forgot a line with the absolute path ... it should be getimagesize(/web/htdocs/www.ganso.org/home/gallery/modules/map/basemarkers/marker.png).

The line 389 should be:
{code]
$currentsize = getimagesize($basegallerydir."modules/map/basemarkers/".$basemarkername.".png");
[/code]

It's most likely the reason for the marker to fail to be created.

Ooops. Now I just get an unkown marker creation error, with the same result (just a "colorlist" file) :(

Thanks anyway!

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sun, 2005-10-23 17:13
djrm2 wrote:
There is a problem when clicking on the 'zoom in' link on the image preview obtained by clicking on the marker.
What happens is that the zoom in goes to the wrong place on the map.
The problem is different depending upon wether ie or Firefox is used.
With ie the problem can be worked arround by first double clicking on the marker, this centres the map on the marker.
The single click to open the preview and then click on the zoom in link.
Using firefox the double click does not centre the map so there is not a workarround.
What seems to happen is that zoom in goes to the centre of the map, not some other image as I first thought.

That's intersting it should be possible to fix that

EDIT: after trying on my PC I don't have that same behaviour, I'm using firefox 1.0.7 and the install is on a windows box (i haven't try on the linux yet). It seems to work fine for me, it always zoom in and I see the marker I just opened.

djrm2 wrote:
A funny thing is happening. Whatever size I choose for the markers they always appear the same size on the map.
The marker images are being generated with the correct sizes but they always render the same size regardless.

I've noticed that for a while now it's because the size was hard coded in the ShowMap.tpl, i'm looking at making it dependant of the image size, but I never got around to it.

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sun, 2005-10-23 17:14
djrm2 wrote:
from the outside it is http://host/gallery2/modules/map/ ...
but internally it is /usr/share/gallery2/modules/map/...
but web root is at /var/www/... (thats where I had to put the 3 files)
GXMagnifier worked fine from /gallery2/modules/map/.. when I had it there by mistake

edit: I have just tried this again but it seems that the .png fileS do need to be in the web root (but not the javascript)

I have a found a nice to way so that the GxMagnifier can reside in the map module directory, I'll be posting the update some time later today, I have to go for the moment.

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sun, 2005-10-23 17:22
TheGoOse wrote:
Quote:
That's because I forgot a line with the absolute path ... it should be getimagesize(/web/htdocs/www.ganso.org/home/gallery/modules/map/basemarkers/marker.png).

The line 389 should be:

$currentsize = getimagesize($basegallerydir."modules/map/basemarkers/".$basemarkername.".png");

It's most likely the reason for the marker to fail to be created.

Ooops. Now I just get an unkown marker creation error, with the same result (just a "colorlist" file) :(

Thanks anyway!

Can you try to change the line 454 with

$command = 'convert '.$modul.$resize.' "'.$basegallerydir."modules/map/basemarkers/".$basemarkername.'.png" "'.$basegallerydir.'images/map/'.$setname.'/marker_'.$color.'.png"';

If it still does not work, I'd like you to add before line 455 a line that says
echo $command;

it will make it easier for me to troubleshoot :)

Thanks

--------------------
The Termite :-)