Hi there...
As I asked a while ago about the auto zoom function in google map for the album folders when you have multiple points was broken it got fixed after that.
However now it has broke again after the change in google map code. Has the function changed or did auto zoom fall out of place.
It is such a great feature to have. especially when I do shooting in multiple countries.
As well has google map become heavier on the bandwidth then it was before?
Comments
We have not had this kind of code in the plugin ever to my knowledge.
http://www.zenphoto.org/documentation/plugins/_plugins---google_maps.php.html#functionprintAlbumMap
`
string $zoomlevel: the zoom in for the map. NULL will use the default (auto-zoom based on points)
`
Here is the forum post I made about this and the mention of auto zoom is there below.
http://www.zenphoto.org/support/topic.php?id=4080
Well if it is not there, I wonder about the code there you just sent, I haven't looked at it to closely but I wonder how hard it is to add to ZenPhoto?
AutoZoom is such a great feature when working a lot with GPS photos, as I do, I tag all my photos automatically with GPS coordinates. AutoZoom would only apply to MapAlbum then.
I'm not that competent with Javascript, so I won't attempt the addition.
Autozoom used to work, you are correct.
In version 1.1.7 it functioned properly. As of the new 1.2 series (AFAIK) a lot of the google maps code was replaced ... much of it is almost-completely broken now.
I downgraded to 1.1.7 because of the missing functionality.
maybe I am not crazy after all remembering that it used to work...
I have been wondering as well is it true as it is now that google maps is loading a lot slower then it used to?
so... is there a change in how google maps gets displayed or how zenPhoto asks for the info.
While I remember happy new year to yah all.
Yep, you can see an example of autozooming working in 1.1.7 (with the minor gmaps tweak, silly Google)... http://photos.thenullpointer.net/Cougar Rock 200707/
Are you using 1.2.2 of ZenPhoto and older version of the plugin.
or are you using 1.1.7 for the whole thing?
ether way would you like to share your tweaked code (gmaps tweak) for others to have a look at?
@sbilliard
I guess it would be worth a look and compare the codes in these 2 as we have a working sample right there.
Is it not possible to display google maps for folders.
Say I have a folder called 001 and inside that one is 0a , 0b and 0c.
I can get a map showing inside each of the 0x folders but is it possible to get a map to display for 001 and displays all the details from these 3 0x sub folders? Do you follow me?
I don't know if a diff of my changes would help. It looks like ZP is using the full PhoogleMaps library now (and the full library seems to be much better than when I made PhoogleMapsLite) and a quick diff of the google_maps.php ZP-plugin shows a lot of changes (much of it might be formatting, I didn't look too deep).
I will have a better look myself later, but if anyone is interested.
http://forums.overclockers.co.uk/showthread.php?p=12806520
`
var minLat=49.1810862;
var minLng=-1.5333333;
var maxLat=53.9833333;
var maxLng=3.2250023;
botLeft = new GLatLng(minLat, minLng);
topRight = new GLatLng(maxLat, maxLng);
bounds = new GLatLngBounds(botLeft, topRight);
map.setCenter(new GLatLng(((maxLat + minLat) / 2.0),((maxLng + minLng) / 2.0)),map.getBoundsZoomLevel(bounds));
`
P.s.
On the other subject about sub folder grabbing
I wonder how hard it will to make a `printAlbumSubFolderMap` function
Or if you have time to get it up for discussion what people would prefer in the default version.
Thanks yet again..
P.s. `printAlbumSubFolderMap` function is and will be still a big no no?
Regards
Eric
As for the auto zoom I think there is a dedicated function for that in the google API, would have to look there. Otherwise there is a library(that can also be found on the google api website) that extend the functionnalities concerning auto zoom and gives more option on binding neighbourgh points together depending on the zoom level.
For big albums the situation were you have 100s of points on the map is bouund to happen, and this will result in lower performance. If I remember, binding multiple point into a single one is suppose to help that, and also clean up the mess
regards
Eric
It would fetch info from the photos inside of subfolders. Lets say you could have a map for your whole gallery right on the front page or in album.php with sub folders.
Connected to that I am wondering about babar_e comment about binding points and the possibilities there for bigger albums.
When you zoom, then the map would have to request in live the individual markers if the zoom level is enough to distinguish between them.
But I believe this is a long term development
Meanwhile for autozoom in using google map functions you can have a look there:
http://groups.google.com/group/Google-Maps-API/browse_thread/thread/60707f79305efc96/f81f365b292b6422?lnk=gst&q=centerAndZoomOnBounds&pli=1
It looks simpler than the current one, but not sure how fast it is:
GMap2.prototype.centerAndZoomOnBounds = function(bounds) {
var center_lat = (bounds.getNorthEast().lat() +
bounds.getSouthWest().lat()) / 2.0;
var center_lng = (bounds.getNorthEast().lng() +
bounds.getSouthWest().lng()) / 2.0;
if(bounds.getNorthEast().lng() < bounds.getSouthWest().lng()){
center_lng += 180;
}
var center = new GLatLng(center_lat,center_lng)
map.setCenter(center, map.getBoundsZoomLevel(bounds));
http://code.google.com/intl/fr/apis/maps/documentation/overlays.html#Marker_Manager
If you look here at the map.
http://www.olihar.com/gallery/Photos/People/
it is like the auto-zoom function is not working 100% right. It would be great if the zoom level was just 1 more zoom level out in this case.
Just a quick note.