![]() |
|
zpOpenStreetMap() Overview Photomap - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: zpOpenStreetMap() Overview Photomap (/thread-12288.html) Pages:
1
2
|
zpOpenStreetMap() Overview Photomap - wibbi - 17-03-2018 How can I create a photomap page with the zpOpenStreetMap() plugin that shows all photos of all albums? zpOpenStreetMap() Overview Photomap - acrylian - 17-03-2018 Use the class directly and pass an array of all geodata you want to the Generally the plugin is setup so you can use it for any kind of geodata, e.g. it must not even use albums/images from Zenphoto itself. zpOpenStreetMap() Overview Photomap - wibbi - 17-03-2018 I have never done anything with classes. This is absolutely new for me. First question: I do not understand how I get to the images of the subfolders. zpOpenStreetMap() Overview Photomap - acrylian - 17-03-2018 The core of Zenphoto is class based. You basically have to loop through all albums recursively via the gallery class and then album class on each. You could also get all album names from the database directly but you still need to create album objects and check on them as you otherwise will bypass publish status or protection which is inherited from parents. Basics of the object model behind everything: zpOpenStreetMap() Overview Photomap - wibbi - 17-03-2018 I have not found a function to grab all image filenames in subfolders from a parent folder. I will rewrite the [code]$All_SubAlbum_IDs = getAllSubAlbumIDs(); And than i can display the zpOpenStreetMap() Overview Photomap - acrylian - 17-03-2018
Create an album object for an album and get its images via the appropiate method Note that you your code does not check for the publish state of the images and Again you should extend the plugin class either theme based or via an additional plugin and modify any method of the original class you need different. zpOpenStreetMap() Overview Photomap - wibbi - 18-03-2018 I understood that differently. In a parent album, where there are only sub albums,
How does it work? How does the
zpOpenStreetMap() Overview Photomap - acrylian - 18-03-2018 An album can have both images and sub albums.
The article I linked above explains how the object model works with examples. If object orientation in general is new to you please see here:
It doesn't itself. Basically the functions/class methods who deliver the data do that and only deliver what is allowed. zpOpenStreetMap() Overview Photomap - wibbi - 18-03-2018 I hang. How do I get the latitude and longitude of an image? zpOpenStreetMap() Overview Photomap - acrylian - 18-03-2018 No, because it does not work that way. You cannot use class methods directy… This should work: Create an image object of
Add arrays within the array for every further image. Then either setup a map object:
Or use the procedural wrapper: This will get you a map outside any album/image context since you wanted all images. Be aware that hundreds or thousand markers will make the map probably quite slow. zpOpenStreetMap() Overview Photomap - wibbi - 18-03-2018 Hey, many thanks. I would never have thought of the solution. For title and desc only one string is needed? What happens if I leave title and desc? I do not want to show both. zpOpenStreetMap() Overview Photomap - acrylian - 18-03-2018
Only lat/long is required in that array, leave blank what else you don't need. zpOpenStreetMap() Overview Photomap - wibbi - 18-03-2018 ...don't work. this is the This is in the HTML source code:
display no map, only a grey box. zpOpenStreetMap() Overview Photomap - wibbi - 19-03-2018 My mistake. I started the array $geodata with 1. Why? I forgot. With 0 it works. zpOpenStreetMap() Overview Photomap - wibbi - 19-03-2018 The test was in /themes/mybasic/album.php. zpOpenStreetMap() Overview Photomap - acrylian - 19-03-2018 Of course not, it its either dependend on the current album or you have to pass one. To get all albums try this:
This is untested code, roughly written down rather offhand. zpOpenStreetMap() Overview Photomap - vincent3569 - 19-03-2018 hi, maybe, could be used with zpOpenStreetMap plugin. zpOpenStreetMap() Overview Photomap - acrylian - 19-03-2018 Using a dynamic album is of course a way as well and should work. zpOpenStreetMap() Overview Photomap - wibbi - 19-03-2018 Thank you vincent, but I did not want to use Google Maps anymore, but OSM (and preferably with OpenLayer instead of Leaflet). It now works with the OSM plugin. An overview in the index.php, an overview in parent albums in the album.php. But there is a problem. As soon as I want to display thumbs in the index.php OSM, there is server timeout. It loads too long. Even larger parent albums and sub-albums load very long. This blocks the page. zpOpenStreetMap() Overview Photomap - acrylian - 19-03-2018 You have to go through a lot of data and you have to load a lot of thumbs that also need to be generated (if you haven't precached them).
You can of course create your own custom plugin to use that. I choose LeafletJS because I like it better. |