Open Street Map in 1.6

Ralf Member

Hi,

i am a little bit lost with this:
How can i print a map with all geo-tagged images on a page.

Already tried to add:
printOpenStreetMap(); (within php tags)
to the code block of the page - but that does not work.

I am pretty sure that printing a map on a page with open streetmap plugin was possible in older zenphoto versions.

Would be great if someone points me in the right direction.

Thanks
Ralf

Tags:

Comments

  • Ralf Member

    The turorial here:
    https://www.vincentbourganel.fr/news/map-of-geo-localized-pictures/

    does not seem to work with 1.6

  • fretzl Administrator, Developer

    Meanwhile few things have changed.
    Follow the tutorial exactly but the code in the codeblock should now be:

    <?php
    $album = AlbumBase::newAlbum("youralbum.alb");
    if (is_object($album)) {
        makeAlbumCurrent($album);
    } ?>
    <div>
        <?php  openStreetMap::printOpenStreetMap(NULL, NULL, NULL, NULL, NULL, NULL, '', NULL, $album); ?>
    </div>
    
  • Ralf Member

    Hi fretzl,

    thanks for your answer, but i am running into two problems with that code.
    When I insert it with the div tags in codeblock1 I get a "403 forbidden" server error.

    I changed the code to:
    <?php $album = AlbumBase::newAlbum("myalbum.alb"); if (is_object($album)) { makeAlbumCurrent($album); } openStreetMap::printOpenStreetMap(NULL, NULL, NULL, NULL, NULL, NULL, '', NULL, $album); ?>

    which works fine with the zenpage theme.

    But with the bootstrap theme (current 1.6 ready version", i see the images in the source code of the page, but no map displayed.

    You can see it on my testpage:
    https://testing.ralf-kerkhoff.de/

    and go here:
    https://testing.ralf-kerkhoff.de/seiten/karte/

    You will see that switching to bootstrap makes the map disappear.

    Cheers
    Ralf

  • acrylian Administrator, Developer

    I am pretty sure makeAlbumCurrent()is not necessary at all. Just passing the album object of the album should be enough.

    Our fork of the zpBootstrap theme is just generally fixed for the general 1.6+ changes. But not really maintained still.
    If you don't see any map that probably means the theme does not support codeblocks or not the codeblock number you are using.

  • fretzl Administrator, Developer
    edited January 13

    I am pretty sure makeAlbumCurrent()is not necessary at all. Just passing the album object of the album should be enough.

    Yes, you're right.

  • fretzl Administrator, Developer
    edited January 13

    Got it.
    zpBootstrap expects your custom map page to be titled "Map" (or "map" lowercase).

    If you don't want that you can change line 11 in inc_header.php from

    if ( !((($_zp_gallery_page == 'pages.php') && (getPageTitleLink() == 'map')) || ($_zp_gallery_page == 'album.php')) ) {

    to

    if ( !($_zp_gallery_page == 'pages.php') || ($_zp_gallery_page == 'album.php') ) {

    And the code for the codeblock in zpBootstrap can be as simple as:

    <?php
    $album = AlbumBase::newAlbum("your-dynamic-album.alb"); 
    openStreetMap::printOpenStreetMap(NULL, NULL, NULL, NULL, NULL, NULL, '', NULL, $album); 
    ?>
    
  • Ralf Member

    Hi Fretzl,
    changing the title to 'map' works without problems!

    Thanks for your help.

    Ralf

Sign In or Register to comment.