improvement of googleMap plugin

vincent3569 Member, Translator
Hi,

I am trying to to some improvement of googleMap plugin.

In order to do that, I have some questions:

1/ you replace ',' by '.' in exifs data 3 times in the plugin :
- in googleMap.php, function getGeoCoord()
- in GoogleMap/googleMap.php (as a hack of original class),
     - function getAddMarkersJS()
     - function getMapJS()

with 3 times ? the first one in googleMap.php seems to be enough , don't you think ?

2/in googleMap.php, function getGeoCoord()
why did you write that code ?
`
$lat_c = explode('.',str_replace(',', '.', $exif['EXIFGPSLatitude']));

$lat_f = round((float) abs($lat_c[0])+$lat_c[1]/pow(10,strlen($lat_c[1])),5);

`
why this code in not enough to convert string in float:
`$lat_f = round((float) (str_replace(',', '.', $exif['EXIFGPSLatitude'])),5);`

3/ in googleMap.php, function getGeoCoord()
`if (strtoupper(@$exif['EXIFGPSLatitudeRef']{0}) == 'S')`
can you explain that code ? I amunable to understand what it means...

Comments

  • vincent3569 Member, Translator
    hi,

    I have created an issue on github (https://github.com/zenphoto/zenphoto/issues/238) to improve googleMap plugin.

    In a first time, I wished to have a better behaviour when a lot of photos have a close location. In that case, display only a single pin, and after a clic on the pin, allows to navigate between thumbnails in the info windows.

    Sbillard has made some improvements to enable clustering of pictures.

    On my side, I have a look on the Net and I have found an interesting library OverlappingMarkerSpiderfier which enables to separate near Markers.

    I have tried to implement that library with existing plugin but the google map api v3 class is a headhach and is very bad coded (I am not an php expert, but many part of the code are unreadable and ununderstandable...)

    So I sought for another google map api v3 class and I have rewrited the plugin.

    There are some improvements with this new release :
    - allows clustering, with a parameter 'max zoom level' in admin
    - allows separation of very close markers (like panoramio in google earth)
    - allows a stylized info window : displays title and desc of picture, displays a thumbnail sized thumbnail independent from the thumbnails size sets for the theme)
    - allows autoclose info windows when click on another pin or click on the map.

    sbillard andacrylian, I hope you will be interested by this rewrite of the plugin and it will replace existing one.

    you can see it in action here :
    http://dev.vincentbourganel.fr/20120623-randonnee-vercors/

    how should I do to give you this plugin ?
  • You could make the plugin available on GitHub for evaluation. Is it a direct replacement for the current plugin? That is, can a user simply select your plugin in place of the current Zenphoto one?
  • vincent3569 Member, Translator
    I've coded as a replacement of actual googleMap plugin (in zp-core/zp-extention), for zenphoto 1.4.5 release (but it works with 1.4.4.x).

    I closely followed the existing code (I reproduce functions, and the map file with colorbox option).

    There are some strings added or modified to traduct.

    The only thing I have not managed to do is use the parameter "callback".

    Of course, for replacement of existing official plugin, there should be some code revue by you, and some tests by multiple users (everything works well for me on the current version 1.4.5).

    If you are OK, you could reopen the existing ticket on github and then I will add zip file with the plugin files.
  • acrylian Administrator, Developer
    I think you cannot attach any files to tickets except images. Do you have a GitHub account? If so upload it as a repository so we can test it.
  • vincent3569 Member, Translator
    I do not quite understand the functioning of github but I got to create a repository for the new version of the plugin :
    https://github.com/vincent3569/GoogleMap

    let me know...
  • acrylian Administrator, Developer
    Yes, GitHub is a bit abstract, inconvenient and inintuitive but a nice tools. A repository like that is what we meant. That way we can test it (specifially sbillard as I have no geotagged photos at all).
  • You should create a new ticket. Technically you would do a pull request on your code, but maybe just include that link in your issue ticket. We would not include this in 1.4.4.x, so keep the repository in case someone wants to use it on that release.
  • vincent3569 Member, Translator
    sbillard,
    of course, I am OK to not include this release in the 1.4.4 stream.
    zenphoto users are free to download it and replace initial plugin in their installation.
    would you please reopen my initial ticket (https://github.com/zenphoto/zenphoto/issues/238) ?
  • No, as I said, this should be a new issue on GitHub. You can do that yourself. This is a new capability not at all the same as the original request so it is not appropriate to attach it to that request.
  • vincent3569 Member, Translator
    thanks to have accepted my re-implementation of the googleMaps plugin.

    a new feature of this plugin could be the following :
    for grouped marker, have a "look like" Panoramio in Google Earth (infoWindow with a slideshow between all thumbnails).

    the scenario to implement this new feature :

    - in the JS configuration of MarkerClusterer :
       - set zoomOnClick to false to disable auto zoom on clustered markers
       - add a function on 'click' event on clustered marker : getMarkers() to obtain the array of markers managed by the clusterer.
       - generate an html code which displays the first thumbnail of the array and displays a carousel of all the tumbs of the array (using jcarousel for example).
       - open an infoWindow with this html

    if somebody could help me to this new feature...
Sign In or Register to comment.