Dear all,
I would like to have the google map created by the gmap module
separately into my webpage. I don't use any default blog like wordpress or so.
Is there a way to easily embed only the map into my page?
When I click on of the markers I would like to open a new page
where the actual album shows up.
Thanks in advance,
Kind regards,
Roy
Posts: 1894
Hello !
This should all possible
1. You need to access the map via /main.php?g2_view=map.ShowMap&g2_fullScreen=1 which will remove the them around the map and you can then embed it wherever using @readfile()
2. You also need to set the Info-Window Template (Admin Page -> Theme) to one of the g2* template, these open the photo/album page in a new window
Hope this helps !
-------------------------
The Termite - - http://www.termitenshort.com/
Posts: 28
Hi Termite,
I'm very happy that this will be possible.
However the fullScreen parameter does not seem to work for me.
I use gallery 1.2 with gmap module 1.07.
http://www.ropel.nl/gallery/main.php?g2_view=map.ShowMap&g2_fullScreen=1
What could be wrong?
Thanks again
Posts: 1894
I'm not sure you got the version correctly
There was no map module for gallery 1.x and there is no map module > 0.5.2 yet
My guess is that you're not using the SVN version and it may be that this modification is in there ... if that's the case, you'll either have to wait for the release (few weeks now) or get the SVN version
-------------------------
The Termite - - http://www.termitenshort.com/
Posts: 28
Ah, stupid!
I was looking in my folder, and I accidentally took the version number
of the map theme that I've downloaded. So currently I use 0.5.1.
I have the map fullscreen now . Can I change to open the album in
a new window without being force to a specific theme?
Furthermore I found that the SVN version uses the PHP5 function stripos.
Replacing that with strpos makes it accessible for more people.
When I add a route I get the error that system() cannot be called for security
reasons. I verified with my host, and they will not enable this call.
The route shows up, but my markers disappear (although their shadows remain).
Is there a workaround?
Thanks again.
Posts: 1894
Hello ropel,
Thx for pointing out these things that need changing.
I'm gonna take a look at the system() call and use some gallery calls instead to generate the markers (those are generated because they get a number on them).
Concerning the template, you can use others if you like and simply copy the code to do a javascript:popup instead of a straight href to view the album. The templates are located in modules/map/templates/infowindow/, also I realized that all the g* templates were actually opening in a new window, the only ones not like that are centered, default, tabbed & table but the gcentered, etc ... are identical with only the difference that they popup (if I remember correctly).
So are you now using the SVN version of the map ? I'll be making some changes to fix the system() call later tonight.
Thanks !!
-------------------------
The Termite - - http://www.termitenshort.com/
Posts: 508
Termite,
I'm working on these system() calls and converting them to use $platform->exec() instead. I'm already half done, I'm just trying to make sure the -draw text command is properly formatted/escaped. I already fixed the stripos() calls that I stupidly put in.
Posts: 28
Awesome support I must say!
I'm currently working with the SVN version.
I'll wait untill these minor issues are fixed,
and meanwhile I'll see if I can embed the map
Posts: 1894
Well I was almost done myself ...
-------------------------
The Termite - - http://www.termitenshort.com/
Posts: 28
I'm very pleased with the results so far.
Maybe it would be useful for you to know that
when using the @readfile function special
characters don't translate well.
(Check the Haverud marker)
http://www.ropel.nl/gallery/test2.php
One more question still. If I put my php file outside
of the gallery directory the links will fail. (Not surprisingly)
Which variable takes care of the item links?
Can I do something like this:
<? $itemlinkdir = "http://www.mysite.nl/gallery/";
@readfile($itemlinkdir."/main.php?g2_view=map.ShowMap&g2_fullScreen=1");
?>
Thanks and keep up the good work!
Posts: 508
Okay, the fix is done and committed to SVN. The system() calls are gone and replaced with $platform->exec() instead. The route marker creation gave me headaches (convert -draw text is picky about quoting--it requires that you use both single and double quotes--so it caused some grief when it was surrounded by quotes in exec().) I wasn't able to test the code in a Unix environment but I believe it should still work. Someone please let me know if the route markers show up when run on a Unix server.
Posts: 28
I happen to have a Unix environment, so I did the test this morning.
I did a clean install of the module from the SVN. I've added three markers and a route.
The marker show up now, however the route not anymore!
http://www.ropel.nl/gallery/test2.php
Any ideas on my previous question for embedding the map into a file outside the gallery dir?
Kind regards
Posts: 508
I don't see any route markers (they should have a number inside the icon), and looking at your page source, the points for the route is empty. Are you sure you saved the route?
I'm not the expert on embedding the map, but I can take a look. I'm guessing the problem is relative links. Could you set up a test page outside the gallery directory like you described so we could look at the source?
Thanks!
Posts: 28
I'm very sure that I did save the route. It also shows in the route settings tab.
Route ID Route Name Route Line Color Route Line Width Route Line Opacity
1 Scandinavië #FFFF 003 1
My normal gallery:
http://www.ropel.nl/gallery/main.php?g2_view=map.ShowMap
Embedded inside the gallery folder:
http://www.ropel.nl/gallery/test2.php
Embedded outside the gallery folder:
http://www.ropel.nl/v2/nl/test2.php
Let me know if I can provide any further information.
Thanks!
Posts: 508
It would seem that it doesn't believe the route is enabled. This is probably a language issue, because it's looking for the text "Yes", and your settings probably say something different, or maybe it's a Unicode issue. In any case, the route storage is very brittle to changes like this and it's something we'll be looking at probably shortly after this imminent release. You could experiment by changing your language to English and see if that fixes it.
I'm working on some changes to make the links absolute so you can embed outside of the gallery directory, but it will take a while because there are a lot of places to change.
Posts: 28
Changing the language did not help. I keep following the updates.
When I have some spare time I'll see if I can find where it checks
whether the routes are enabled and if that check fails or not.
Thanks for looking into the absolute links
Posts: 508
Sorry, I don't have an easy answer for the routes right now. However, I did commit a couple changes to create absolute links. See if they work for you now.
Posts: 28
Hi SilconFiend,
I've just checked your recent changes. Absolute links work perfectly now
Strange thing is however that the last marker in my set does not show on a map outside the gallery folder.
(Although I can click on it. Try to click somewhere near Uppsala on http://www.ropel.nl/v2/nl/test2.php)
I guess you've missed just one link somewhere.
I also deleted the route that I had and create a new one with no success.
Hopefully this will be solved in one of the next releases.
Thanks again
Posts: 508
Actually, something I did completely broke the links for the icon images--they're all relative now. The one that I missed is the only thing that's working! I'm not sure why; I tested it here and all the links were absolute. Are you sure you updated ShowMap.inc as well?
I'm going to have to move a bunch of stuff out of the template and into the PHP file. That's really where it belongs anyway. I may not be able to fix this completely before the release. I'll keep working on it, but if we can't fix it in time, it will be a high priority shortly after.
Posts: 28
Yes, I'm positive that I've updated my ShowMap. I'll reinstall the entire module shortly, since I don't have that many setting yet I can do a clean install.
Posts: 508
Hmm... It's hard to say what's going on, then. The key part is the fullUrlOptions array in ShowMap.inc.
If that's missing, it will still create relative links. I re-tested it using my own external file outside the gallery directory (except using curl instead of readfile) and all the icons and links were absolute, full URLs.
Posts: 1894
There shouldn't be an issue with that, because this should be stored in the DB as "yes" (i.e. hard coded in English)
-------------------------
The Termite - - http://www.termitenshort.com/
Posts: 1894
From the code and what's shown in the source, I can conclude that there is a route setup (only 1) but there are no items attached to that route, in other word, you need to edit the route, check some boxes and enter the order of each item
The all route system is currently quite primitive and slightly dumb, but It will be re-done in full after this upcoming release.
If you check + order items to that route, then it will show up ;-)
-------------------------
The Termite - - http://www.termitenshort.com/
Posts: 1894
Also for the URL being, we should force them all to be "Direct" as well as "full" meaning right from the gallery source-code wherever they are called (forceDirect = true) and that should fix this.
later !
-------------------------
The Termite - - http://www.termitenshort.com/
Posts: 508
Ah. Since I don't have an embedded install set up, I didn't see the need for forceDirect. I understand what it's for now. I'll change it.
Looks like you're right about the empty route, too. The addOverlay call for the GPolyLine is in the generated HTML source, so that means that the "Yes" is there for that route (since that line is inside the {if} block). I still don't know why the links are relative, though.
Posts: 28
As promised I did a clean install. Things look slightly better now. Someone changed the "Get Via Map" default location. Pretty convenient, thanks .
My new route shows up. But again with problems that my host does not allow me to call "exec()".
Will there be a fix for that in the near future? Otherwise I'll have to live without the routes in my map ;).
My test setup can be found at the same location.
Posts: 508
If your host won't allow system() or exec(), then how are you able to get Gallery working at all? It uses exec() for the imagemagick calls. Maybe you're using gd? Anyway, I'll look at adding a way to gracefully degrade and show the default item marker (without the route sequence number shown on it).
Posts: 28
Thanks! And yes I'm currently using only GD because of their policy.
They say they have ImageMagick installed, but they won't allow exec calls.
Kind of stupid to provide something which you cannot use afterall..
Posts: 28
Just discovered some other small things. I hope you consider this as valuable feedback, I don't mean to be intrusive in any way.
When using the embedded mode, the links in the popup windows don't get their default style assigned. Probably the link to some css formatting is missing. (Note the blue line around the image).
Furthermore you might consider removing the "The photomap" title and movement navigator, since you want to provide a fullscreen solution. Anyway I can easily remove those. Just for your consideration.
Posts: 508
Those are good suggestions. I'll see what's going on with the CSS. It may be the same problem as before with the relative/absolute links.
Posts: 1894
There will be several "fullscreen" mode available when this is all completed. One of which will be only the map which extend to whatever space is given to it's container
See you soon !
-------------------------
The Termite - - http://www.termitenshort.com/
Posts: 28
Is it right that the latest SVN version only support Gallery 2.2?
I get this error (In dutch, but you'll get the point hopefully):
Show item on a Google Map Using the API
Niet compatibele module!
Core API Vereist: 6.0 (beschikbaar: 7.3)
Module API Vereist: 2.0 (beschikbaar: 3.0)
Kind regards,
Roy
Posts: 1894
I think 6.0 & 2.0 is Gallery 2.0 but I'm not certain, the module in SVN only works for Gallery 2.1 & up
See you !
-------------------------
The Termite - - http://www.termitenshort.com/
Posts: 28
Status update
I've installed the latest svn version (stupid mistake...took the wrong module last time )
I have overwritten the source file and reactivated the module afterwards, I hope that is sufficient.
I have only two problems remaining. The marker icons are still using relative URL.
Futhermore I would like to know if there is a solution to the incorrect translation of 'exotic' characters
when using @readfile. (Things like this: Håverud)
http://www.ropel.nl/v2/nl/test2.php
Thanks
Posts: 27300
@readfile, you could try curl. Something similar to:
http://codex.gallery2.org/Gallery2:How_To_Use_The_External_Image_Block_When_url_fopen_Is_Disabled
Just a guess.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 508
Ah. I finally figured out why you keep getting relative URLs. You're using Gallery 2.1, which doesn't support the options= parameter that I'm using in the template. I would need to pull those into the PHP file instead of the template (which is where they should be anyway). But I don't think I'll have time to fix this before the release, so for now anyway we'll just have to say if you want to use the map outside of the Gallery directory, you'll have to use Gallery 2.2+. Right after release I'll look at fixing that, though (I've already got a major rewrite in the works), and back-patch it for Gallery 2.1.
By the way, your external site has a problem--you have two <html> blocks. I'm sure the second, inside one is coming from the Map link, so I'll look to see if I can strip it so it can be embedded more easily.
Posts: 28
I noticed the double <HTML> blocks. Which is of course a bad thing, but since it works I got to live with it for now
I'll keep following the progress. Please let me know when I can be of use for testing the embedded configuration.
Kind regards,
Roy
Posts: 508
Okay, I took pity on you and reverted some of my absolute url changes so now it should be compatible with Gallery 2.1 (also in keeping with our goal of supporting 2.1 for this release). I think the styles work now, too. There are still some outstanding issues, such as the filters dropdown list doesn't work correctly in embedded mode. That might be tricky to fix. Also, I still haven't looked into stripping the extra <html> tags. That also might require a lot more work than we have time for prior to release.
Posts: 28
Superb, I'll give it a try as soon as possible. I'll let you know what the results are.
Thanks
Posts: 28
Just updated to the latest SVN version, and direct links are fine now. Including the reference to the stylesheets
I'm pretty happy with the map now. Hopefully the routes will come available without ImageMagick sometimes.
Great work!
Posts: 28
Yet two other questions.
First I'd like to point out that the @readfile and the curl approach fail to read unicode characters such as ö,å, etc.
Does anyone have other suggestions to read out the html properly, remaining the correct characters?
Furthermore I've changed the infowindow template in order to fit my website. However I can't seem to resize the white balloon itself,
but only the <div> inside. Where is the actual balloon declared?
Regards,
Roy
Posts: 27300
I think you can try to send a header to say its utf-8. I don't remember the exact syntax for sending headers.
@balloon, If I remember right the balloon conforms to the contents, so make the div inside bigger. It is a Googlemap API not module/gallery API.
Dave
Posts: 508
Do you mean that the URL contains unicode characters, or that the HTML file that's returned contains those characters (like titles)?
The white balloon is called an Info Window and is declared in the modules/map/templates/infowindow folder. Just modify the file that matches the one you selected in the Theme Settings tab (or default.inc if you didn't select one). You'll see the "style=width:200px", etc. Those should really be put into a stylesheet for easy modification, but that will come later. There are plans for allowing total customization of the info windows.
Posts: 28
The unicode characters are contained in titles of my picture. The Swedish seem to like these characters
I've copied such a template to create my own style and I have changed all values. However the balloon remains
fairly large when I reduce the size of the div that contains the picture. Is there a solution to this?
Roy
Posts: 508
ropel, I think it's time for you to switch providers ;-) I tested it with curl on my development machine with PHP 5.2 and the unicode characters came through fine. I also tested it by linking to YOUR site with a curl on my machine, and the unicode still came through fine. I'm guessing your provider is probably using some old PHP or curl version that doesn't support unicode properly.
Did you try it without your header and footer? Maybe the extra HTML block is screwing up the browsers. By the way, I can't fix that generated HTML block without a major rewrite of the "fullscreen" code. I did add two more modes, as requested by Termitenshort, though: g2_fullScreen=2 will remove the "Photo Map" title. g2_fullScreen=3 will take over the entire screen and hide all the other stuff: thumbnail bar, filter list, legend, move history, etc.
As for the infowindows, I saw a post that said the minimum window size is 204x50 pixels:http://groups.google.com/group/Google-Maps-API/msg/dba45a604dbb11f2 I'll keep looking into it, though.
Posts: 28
The fullScreen modes is a very nice addition indeed
I have the map embedded in a picture on my site, so the map is rather small.
So I'm very happy to be able to view the map in different fullScreen modes.
I'll contact my host about the php/curl version and I will try a non header/footer version.
Thanks again for the effort. I'll keep you posted on the progress.
Kind regards
Posts: 28
Aaaah! Absolute links seem to be gone again with latest SVN version
Furthermore I have some remarks on the new fullScreen modes:
fullScreen mode 2: Probably better to also remove the move history.
fullScreen mode 3: Does not work in Firefox. The map seems to be somewhere above the screen.
I've found that indeed the unicode problem depends on my headers. Thanks for looking into that!
A nice suggestion would be to include also a tab in the administration panel for alternative infoWindow styles.
For instance: http://www.econym.demon.co.uk/googlemaps/ewindows.htm
Just a suggestion
Posts: 1894
That may be my fault ... well I'm not sure. I made a change that was preventing multi-installs to work at all -> JS Error due to inability to get to the correct URL for the javascript.
I'm using an embedded multi-install of the map module on my live site and teh code (before the change) was not working at all... I'm afraid we're having conflict of interestes between a simple embed and a multi-instance (or both).
I need to look into this a little more but the "old" setup is not correct so I need to find something else.
I'll let SiliconFiend answer those, he worked on this
Thanks, We were planning on re-doing the infowindow deal completely after this release to allow for creation from the Admin Panel (easier to use) so I this as a good addition to the mix
Thanks !
-------------------------
The Termite - - http://www.termitenshort.com/
Posts: 1894
Please try this:
Open your config.php and change the line:
$gallery->setConfig('baseUri', '');
for
$gallery->setConfig('baseUri', '/gallery/');
This should fix your issue when embedding outside the Gallery folder and still keep the fix in place for multi-installs.
-------------------------
The Termite - - http://www.termitenshort.com/
Posts: 508
Termite,
The baseUri change does not fix everything. In particular, it screws up the margins of the fullscreen map. It must be a style sheet problem.
I fixed the fullScreen=3 for Firefox. It was just a simple stylesheet addition that I had when I was testing but removed before committing because I thought it wasn't necessary.
Posts: 1894
It wasn't intended to fix everything, only the links when using embedded mode outside of the gallery folder and that's it (which it does in a simple embedded situation)
-------------------------
The Termite - - http://www.termitenshort.com/