Changeset 7616


Ignore:
Timestamp:
Nov 4, 2010, 1:42:14 AM (13 years ago)
Author:
grum
Message:

fix bug:2004 - Cache table becomes very huge
fix bug:2005 - Category map is not displayed when a [gmaps] map is inserted in category description

Location:
extensions/GMaps
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • extensions/GMaps/gmaps_aip.class.inc.php

    r7308 r7616  
    9696    global $template;
    9797
     98    $this->cleanCache();
    9899    $this->initRequest();
    99100
  • extensions/GMaps/gmaps_ajax.php

    r7551 r7616  
    10301030    private function ajax_gmaps_public_mapsInit($category, $mapId)
    10311031    {
    1032       global $prefixeTable, $template, $user, $conf;
     1032      global $prefixeTable, $user;
    10331033
    10341034      $requestId='';
     
    10581058
    10591059        // there is some maps to display
    1060         $requestId=date('Y-m-d h:i:s');
    1061 
    1062         // delete cache (for user and data having more than 2h)
    1063         $sql="DELETE FROM ".$this->tables['cache']."
    1064               WHERE requestId<'".date('Y-m-d h:i:s', time()-7200)."';";
    1065         pwg_query($sql);
     1060        $requestId=$this->getCacheRequestId();
     1061
     1062        $this->cleanCache();
    10661063
    10671064        // prepare the cache (same request in the 'GMaps_pip->displayCategoryPageMap' function)
    1068         $sql="SELECT DISTINCT pic.image_id, GROUP_CONCAT(DISTINCT pait.value ORDER BY pait.numID ASC SEPARATOR ';') AS coords,
    1069                 GROUP_CONCAT(DISTINCT pic.category_id ORDER BY pic.category_id SEPARATOR ';') AS imageCatsId,
    1070                 GROUP_CONCAT(DISTINCT pct.name ORDER BY pct.id SEPARATOR ';') AS imageCatsNames,
    1071                 GROUP_CONCAT(DISTINCT IF(pct.permalink IS NULL, CONCAT('*', pct.id), pct.permalink) ORDER BY pct.id SEPARATOR ';') AS imageCatsPLink,
    1072                 pit.name AS imageName, pit.path, pit.tn_ext
    1073               FROM ((((".USER_CACHE_CATEGORIES_TABLE." pucc
     1065        $sql="SELECT DISTINCT pic.image_id, GROUP_CONCAT(DISTINCT pait.value ORDER BY pait.numID ASC SEPARATOR ';') AS coords
     1066              FROM (((".USER_CACHE_CATEGORIES_TABLE." pucc
    10741067                LEFT JOIN ".CATEGORIES_TABLE." pct ON pucc.cat_id = pct.id)
    10751068                LEFT JOIN ".IMAGE_CATEGORY_TABLE." pic ON pic.category_id = pucc.cat_id)
    10761069                LEFT JOIN ".$prefixeTable."amd_images_tags pait ON pait.imageId = pic.image_id)
    1077                 LEFT JOIN ".$prefixeTable."amd_used_tags paut ON pait.numId = paut.numId)
    1078                 LEFT JOIN ".IMAGES_TABLE." pit ON pit.id = pic.image_id
     1070                LEFT JOIN ".$prefixeTable."amd_used_tags paut ON pait.numId = paut.numId
    10791071              WHERE pucc.user_id = '".$user['id']."'
    10801072               AND (paut.tagId = 'magic.GPS.LatitudeNum' OR paut.tagId = 'magic.GPS.LongitudeNum')
     
    11091101
    11101102            $massInsert[]=array(
    1111               'userId' => $user['id'],
    11121103              'requestId' => $requestId,
    11131104              'imageId' => $row['image_id'],
    11141105              'latitude' => $coords[0],
    1115               'longitude' => $coords[1],
    1116               'imageName' => GPCCore::getUserLanguageDesc(mysql_escape_string($row['imageName'])),
    1117               'imageTnFile' => dirname($row['path']).'/'.$conf['dir_thumbnail'].'/'.$conf['prefix_thumbnail'].get_filename_wo_extension(basename($row['path'])).'.'.$row['tn_ext'],
    1118               'imageCatsId' => $row['imageCatsId'],
    1119               'imageCatsNames' => mysql_escape_string($row['imageCatsNames']),
    1120               'imageCatsPLink' => $row['imageCatsPLink']
     1106              'longitude' => $coords[1]
    11211107            );
    11221108          }
    11231109
    1124           mass_inserts($this->tables['cache'], array('userId', 'requestId', 'imageId', 'latitude', 'longitude', 'imageName', 'imageTnFile', 'imageCatsId', 'imageCatsNames', 'imageCatsPLink'), $massInsert);
     1110          mass_inserts($this->tables['cache'], array('requestId', 'imageId', 'latitude', 'longitude'), $massInsert);
    11251111
    11261112          $returned=$requestId;
     
    11451131    private function ajax_gmaps_public_mapsGetMarkers($datas)
    11461132    {
    1147       global $user, $page;
     1133      global $user, $page, $conf;
    11481134
    11491135      $returned=array(
     
    11551141        )
    11561142      );
     1143
     1144      $this->updateCacheRequestId($datas['requestId']);
     1145      $this->cleanCache();
    11571146
    11581147      /*
     
    12051194      }
    12061195
    1207       $sql="SELECT latitude, longitude, imageId, imageCatsId, imageCatsNames, imageTnFile, imageName, imageCatsPLink
    1208             FROM ".$this->tables['cache']."
    1209             WHERE userId='".$user['id']."'
     1196      $sql="SELECT DISTINCT pgc.latitude, pgc.longitude, pgc.imageId,
     1197                   GROUP_CONCAT(DISTINCT pic.category_id ORDER BY pic.category_id SEPARATOR ';') AS imageCatsId,
     1198                   GROUP_CONCAT(DISTINCT pct.name ORDER BY pct.id SEPARATOR ';') AS imageCatsNames,
     1199                   GROUP_CONCAT(DISTINCT IF(pct.permalink IS NULL, CONCAT('*', pct.id), pct.permalink) ORDER BY pct.id SEPARATOR ';') AS imageCatsPLink,
     1200                   pit.name AS imageName,
     1201                   pit.path, pit.tn_ext
     1202            FROM (((".$this->tables['cache']." pgc
     1203                    LEFT JOIN ".IMAGE_CATEGORY_TABLE." pic ON pic.image_id = pgc.imageId)
     1204                    LEFT JOIN ".USER_CACHE_CATEGORIES_TABLE." pucc ON  pucc.cat_id = pic.category_id)
     1205                    LEFT JOIN ".CATEGORIES_TABLE." pct ON pucc.cat_id = pct.id)
     1206                    LEFT JOIN ".IMAGES_TABLE." pit ON pit.id = pgc.imageId
     1207            WHERE pucc.user_id = '".$user['id']."'
    12101208              AND requestId='".$datas['requestId']."'
    12111209              AND ($lngClause)
    12121210              AND latitude >= ".$datas['bounds']['south']."
    12131211              AND latitude <= ".$datas['bounds']['north']."
     1212            GROUP BY pgc.imageId
    12141213            ORDER BY latitude, longitude;";
    1215 
    12161214      $result=pwg_query($sql);
    12171215      if($result)
     
    12241222        $datas['distanceTreshold']=pow($datas['distanceTreshold']*$ratio,2);
    12251223
    1226 
    12271224        $groups=array();
    1228 
    12291225
    12301226        /*
     
    12331229        while($row=pwg_db_fetch_assoc($result))
    12341230        {
     1231          $row['imageName']  =GPCCore::getUserLanguageDesc($row['imageName']);
     1232          $row['imageTnFile']=dirname($row['path']).'/'.$conf['dir_thumbnail'].'/'.$conf['prefix_thumbnail'].get_filename_wo_extension(basename($row['path'])).'.'.$row['tn_ext'];
    12351233          if(!$this->checkInGroup($row, $groups, $datas['distanceTreshold']))
    12361234          {
     
    12381236          }
    12391237        }
    1240 
    12411238
    12421239        /*
  • extensions/GMaps/gmaps_install.class.inc.php

    r7548 r7616  
    8787)",
    8888"CREATE TABLE `".$this->tables['cache']."` (
     89  `requestId` mediumint(8) UNSIGNED NOT NULL default '0',
     90  `imageId` mediumint(8) NOT NULL,
     91  `latitude` decimal(17,14) NOT NULL default '0',
     92  `longitude` decimal(17,14) NOT NULL default '0',
     93  PRIMARY KEY (`requestId`,`imageId`)
     94)",
     95"CREATE TABLE `".$this->tables['cache_id']."` (
     96  `requestId` mediumint(8) UNSIGNED NOT NULL auto_increment,
    8997  `userId` smallint(5) NOT NULL,
    90   `requestId` timestamp NOT NULL default '0000-00-00 00:00:00',
    91   `imageId` mediumint(8) NOT NULL,
    92   `latitude` decimal(20,17) NOT NULL default '0.00000000000000000',
    93   `longitude` decimal(20,17) NOT NULL default '0.00000000000000000',
    94   `imageName` varchar(255) NOT NULL,
    95   `imageTnFile` varchar(255) NOT NULL,
    96   `imageCatsId` varchar(255) NOT NULL,
    97   `imageCatsNames` varchar(255) NOT NULL,
    98   `imageCatsPLink` varchar(255) NOT NULL,
    99   PRIMARY KEY  USING BTREE (`userId`,`requestId`,`imageId`)
     98  `date` timestamp NOT NULL default '0000-00-00 00:00:00',
     99  PRIMARY KEY (`requestId`)
    100100)",
    101101"CREATE TABLE `".$this->tables['kmlfiles']."` (
     
    144144        case '01.01.00':
    145145          $this->updateFrom_010100();
     146        case '01.02.00':
     147        case '01.02.01':
     148        case '01.02.02':
     149          $this->updateFrom_010202();
    146150        default:
    147151          // nothing to do...
     
    218222    }
    219223
     224    /**
     225     * update from release 1.2.2
     226     *
     227     */
     228    private function updateFrom_010202()
     229    {
     230      $sql="DROP TABLE ".$this->tables['cache'];
     231      pwg_query($sql);
     232
     233      $tablesCreate=array(
     234"CREATE TABLE `".$this->tables['cache']."` (
     235  `requestId` int(8) UNSIGNED NOT NULL default '0',
     236  `imageId` mediumint(8) NOT NULL,
     237  `latitude` decimal(17,14) NOT NULL default '0',
     238  `longitude` decimal(17,14) NOT NULL default '0',
     239  PRIMARY KEY (`requestId`,`imageId`)
     240);",
     241"CREATE TABLE `".$this->tables['cache_id']."` (
     242  `requestId` mediumint(8) UNSIGNED NOT NULL auto_increment,
     243  `userId` smallint(5) NOT NULL,
     244  `date` NOT NULL default '0000-00-00 00:00:00',
     245  PRIMARY KEY (`requestId`)
     246)"
     247      );
     248
     249      $tablesUpdate=array(
     250        $this->tables['category_maps'] => array(
     251          'forceDisplay' => " ADD COLUMN `forceDisplay` CHAR(1)  NOT NULL DEFAULT 'n' AFTER `title` ",
     252        )
     253      );
     254
     255      $tablesDef = create_table_add_character_set($tablesCreate);
     256
     257      $tablef=new GPCTables(array($this->tables['cache'], $this->tables['cache_id']));
     258      $tablef->create($tablesCreate);
     259      $tablef->updateTablesFields($tablesUpdate);
     260
     261      unset($tablesCreate);
     262      unset($tablesUpdate);
     263    }
    220264
    221265
  • extensions/GMaps/gmaps_pip.class.inc.php

    r7576 r7616  
    119119    if(preg_match_all('/\[gmaps=(?:id:(?P<id>\d+);|width:(?P<width>\d+);|height:(?P<height>\d+);|markerImg:(?P<markerImg>[a-z0-9\-\._]+);|kmlId:(?P<kmlId>\d+);|kmlUrl:"(?P<kmlUrl>.+)";|allowBubble:(?P<allowBubble>y|n);|kmlZoom:(?P<kmlZoom>y|n);|markerVisible:(?P<markerVisible>y|n);)+\]/i',$desc,$mapParams,PREG_SET_ORDER)>0)
    120120    {
    121 
    122121      if($param!='main_page_category_description')
    123122      {
     
    129128      GPCCore::addHeaderJS("jquery", "themes/default/js/jquery.packed.js");
    130129      GPCCore::addHeaderJS("maps.google.com/api", "http://maps.google.com/maps/api/js?sensor=false");
    131       GPCCore::addHeaderJS("gmaps.category", "plugins/GMaps/js/gmapsMarkup.packed.js");
     130      GPCCore::addHeaderJS("gmaps.markup", "plugins/GMaps/js/gmapsMarkup.packed.js");
    132131
    133132      $desc = preg_replace(
  • extensions/GMaps/gmaps_root.class.inc.php

    r7547 r7616  
    8585      $this->section_name=$this->getPluginNameFiles();
    8686
    87       $this->setTablesList(array('maps', 'category_maps', 'cache', 'kmlfiles'));
     87      $this->setTablesList(array('maps', 'category_maps', 'cache', 'cache_id', 'kmlfiles'));
    8888      $this->css = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles().".css");
    8989    }
     
    312312    }
    313313
     314
     315    /**
     316     * returns a new requestId for the cache
     317     */
     318    protected function getCacheRequestId()
     319    {
     320      global $user;
     321
     322      $returned=0;
     323
     324      // new requestId
     325      $sql="INSERT INTO ".$this->tables['cache_id']."
     326            VALUES ('', '".$user['id']."', '".date('Y-m-d h:i:s')."');";
     327      $result=pwg_query($sql);
     328      if($result)
     329      {
     330        $returned=pwg_db_insert_id();
     331      }
     332
     333      return($returned);
     334    }
     335
     336    /**
     337     * update date for a cache requestId
     338     */
     339    protected function updateCacheRequestId($requestId)
     340    {
     341      global $user;
     342
     343      // new requestId
     344      $sql="UPDATE ".$this->tables['cache_id']."
     345            SET `date` = '".date('Y-m-d h:i:s')."'
     346            WHERE requestId='$requestId';";
     347      pwg_query($sql);
     348    }
     349
     350    /**
     351     * clean the cache : cache values older than given number of second are
     352     * deleted
     353     *
     354     * @param Integer $time : number of second
     355     */
     356    protected function cleanCache($time=300)
     357    {
     358      $date=date('Y-m-d h:i:s', time()-$time);
     359
     360      $sql="DELETE FROM ".$this->tables['cache']." pgc
     361              USING ".$this->tables['cache']." pgc
     362                JOIN ".$this->tables['cache_id']." pgci
     363                ON pgc.requestId = pgci.requestId
     364            WHERE pgci.`date` < '$date';";
     365      pwg_query($sql);
     366
     367      $sql="DELETE FROM ".$this->tables['cache_id']."
     368            WHERE `date` < '$date';";
     369      pwg_query($sql);
     370    }
     371
    314372  } //class
    315373
  • extensions/GMaps/gmaps_version.inc.php

    r7576 r7616  
    1515  if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    1616
    17   define('GMAPS_VERSION',  '1.2.2');
    18   define('GMAPS_VERSION2', '01.02.02');
     17  define('GMAPS_VERSION',  '1.2.3');
     18  define('GMAPS_VERSION2', '01.02.03');
    1919  define('GMAPS_GPC_NEEDED', '3.3.2');
    2020  define('GMAPS_AMD_NEEDED', '0.5.2'); //advanced metadata plugin is needed
  • extensions/GMaps/js/gmapsCategory.js

    r7547 r7616  
    22 * -----------------------------------------------------------------------------
    33 * file: gmapsCategory.js
    4  * file version: 1.1.1
    5  * date: 2010-10-28
     4 * file version: 1.2.0
     5 * date: 2010-11-04
    66 */
    77
     
    426426     'closeclick',
    427427     function () {
    428        $('body').append($('#iGMapsInfoWindowContent'));
     428       //$('body').append($('#iGMapsInfoWindowContent'));
    429429       gmaps.infoWindow.setContent('');
    430430       $('#ciGMIWC_img').unbind();
    431431     }
    432     );
    433 
    434     /*
    435      * initialize map on the server side (call the 'public.maps.init'
    436      * function)
    437      */
    438     $.ajax(
    439       {
    440         type: "POST",
    441         url: "plugins/GMaps/gmaps_ajax.php",
    442         async: true,
    443         data: { ajaxfct:"public.maps.init", category:gmaps.categoryId, mapId:'n' },
    444         success:
    445           function(msg)
    446           {
    447             gmaps.requestId=msg;
    448             for(var i=0;i<gmaps.maps.length;i++)
    449             {
    450               initializeMapViewport('loaded', i);
    451             }
    452           }
    453       }
    454432    );
    455433
     
    482460          open: function ()
    483461            {
    484               initializeMapViewport('open', $(this).data('index'));
     462              /*
     463               * initialize map on the server side (call the 'public.maps.init'
     464               * function)
     465               */
     466              $.ajax(
     467                {
     468                  type: "POST",
     469                  url: "plugins/GMaps/gmaps_ajax.php",
     470                  async: true,
     471                  data: { ajaxfct:"public.maps.init", category:gmaps.categoryId, mapId:'n' },
     472                  success:
     473                    function(msg)
     474                    {
     475                      gmaps.requestId=msg;
     476                      for(var i=0;i<gmaps.maps.length;i++)
     477                      {
     478                        initializeMapViewport('loaded', i);
     479                        //initializeMapViewport('open', $(this).data('index'));
     480                      }
     481                    }
     482                }
     483              );
    485484            }
    486485        }
  • extensions/GMaps/js/gmapsCategory.packed.js

    r7547 r7616  
    1 /* file: gmapsCategory.js - v1.1.1 | packed on 2010/10/30 with http://joliclic.free.fr/php/javascript-packer/ */
    2 eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('u 16=[D,{w:32,h:32,x:15,y:31},{w:32,h:32,x:15,y:31},{w:32,h:32,x:10,y:31},{w:30,h:40,x:4,y:39},];8 2B(l,1m){u 5=o j.3.2Y($("#"+l.q).1U(0),{36:\'#2T\',2S:l.2R,3v:l.1A,3o:2.r.2A(),1F:(l.1F==-1)?v:z,3n:(l.1F==-1)?v:z,2f:(l.2f==\'n\')?v:z,2g:(l.2g==\'n\')?v:z,1q:(l.1q==-1)?v:z,3m:{1M:l.1q},3h:\'\',});9(l.2h!=\'\'){I=o j.3.3p(l.2h,{3i:z});I.2q(5)}C{I=D}2e=/^3j(\\d\\d)3k.*/i;B=2e.3g(l.Z);9(B!=D)B=o 3d(B[1]);9(B!=D){5.Z=o j.3.3e(\'1l/1B/2j/\'+l.Z,o j.3.3l(16[B].w,16[B].h),o j.3.2d(0,0),o j.3.2d(16[B].x,16[B].y))}C{5.Z=D}5.I=I;5.g=o 3u();5.1m=1m;5.1C=v;5.Q=0;l.k=5}8 1a(5){5.Q++;1f={1P:2.1P,Q:5.Q,r:{2D:5.1k().2a().1p(),2E:5.1k().2a().1o(),2I:5.1k().2b().1p(),2G:5.1k().2b().1o()},12:$(5.2c()).12(),13:$(5.2c()).13(),3c:20,1r:5.1m,};$(\'#1L\').m(\'p\',\'V-1D\');$(\'#1Q\').J(\'\');$.2y({2z:"2J",2L:"1l/1B/2O.1T",2N:z,1j:{2x:"2w.3.2P",1f:1f},2H:8(1b){M=$.2U(1b);9(2.3[M.1r].k.Q==M.Q){M.g.2Q(2l);2p(2.3[M.1r].k,M.g);$(\'#1L\').m(\'p\',\'O\');$(\'#1Q\').J(\'[\'+M.1f.38+\']\')}}})}8 2p(5,g){9(5.g.E>0){u i=0;35(i<5.g.E){1t=2s(5.g[i].H,g);9(1t==-1){5.g[i].f.2q(D);5.g.2r(i,1)}C{g.2r(1t,1);i++}}}P(u i=0;i<g.E;i++){u f=o j.3.3w({3t:o j.3.1s(g[i].1p,g[i].1o),5:5,S:g[i].1x});9(5.Z!=D)f.43(5.Z);f.F=g[i];f.F.s=0;5.g.44({f:f,H:g[i].H});j.3.14.19(f,\'26\',8(){2t(W)});P(u b=0;b<f.F.K.E;b++){41(f.F.K[b].3Z(0)){2o\'G\':f.F.K[b]=\'./3W/\'+f.F.K[b].2n(1);29;2o\'U\':f.F.K[b]=\'./46/\'+f.F.K[b].2n(1);29}}}}8 2l(1G,1u){9(1G.H<1u.H){L(-1)}C 9(1G.H<1u.H){L(1)}L(0)}8 2s(1S,1E){P(u i=0;i<1E.E;i++){9(1E[i].H==1S)L(i)}L(-1)}8 2t(f){2.6=f.F;2.N.2v();2.N.2u($(\'#2F\').48().1R(1w).1U(0));2.N.1i(f.5,f);1c(2.6.s)}8 1w(i,e){9(e.q!=\'\')e.q=\'c\'+e.q;$(e).49().1R(1w)}8 1c(b){2.6.s=b;9(2.6.28[b]==\'\'){$(\'#1W\').J(\'&3F;\')}C{$(\'#1W\').J(2.6.28[b])}$(\'#17\').1I(\'2i\',2.6.K[b]);$(\'#17\').2K();9(2.6.1n[b].E==1){$(\'#17\').1y(\'26\',8(){18.3C=2.6.1n[2.6.s][0]})}C{$(\'#27\').J(\'\');P(u i=0;i<2.6.1n[b].E;i++){$(\'#27\').T(\'<24><a 1N="\'+2.6.1n[b][i]+\'">\'+2.6.3z[b][i]+\'</a></24>\')}$(\'#17, #1z\').1y(\'3B\',8(){$(\'#1z\').m(\'p\',\'1D\')}).1y(\'3J\',8(){$(\'#1z\').m(\'p\',\'O\')})}9(2.6.1v>1){$(\'#23\').J((b+1)+\'/\'+2.6.1x);$(\'#1Z, #21\').m(\'p\',\'V-1D\')}C{$(\'#23\').J(2.6.1x);$(\'#1Z, #21\').m(\'p\',\'O\')}}8 3P(){2.6.s--;9(2.6.s<0)2.6.s=2.6.1v-1;1c(2.6.s)}8 3O(){2.6.s++;9(2.6.s>=2.6.1v)2.6.s=0;1c(2.6.s)}8 Y(r,7){2.3[7].k.3M(r);9(2.3[7].3N&&2.3[7].k.33()>2.3[7].1A){2.3[7].k.3L(2.3[7].1A)}}8 1J(1H,7){9(7>-1&&($(\'#\'+2.3[7].q+\'22\').R(\'3T\')&&1H==\'2C\'||1H==\'1i\')&&(2.3[7].k.1C==v)){j.3.14.3R(2.3[7].k,\'3A\');$(\'#\'+2.3[7].q+\' t, #\'+2.3[7].q+\' a\').m(\'3x-3y\',\'3D.0%\');9(2.1X){9(2.3[7].Y){Y(2.r,7)}C{2.3[7].k.3H(2.r.2A())}}C{Y(2.3[7].k.I.25(),7)}j.3.14.19(2.3[7].k,\'3U\',8(){1a(W);$(\'#1d\').m(\'p\',\'V\');$(\'#1e\').m(\'p\',\'V\')});j.3.14.19(2.3[7].k,\'4a\',8(){1a(W);2.N.2v();$(\'#1d\').m(\'p\',\'V\');$(\'#1e\').m(\'p\',\'V\')});2.3[7].k.1C=z;1a(2.3[7].k)}}$(18).45(8(){2.6=D;2.r=o j.3.3Y(o j.3.1s(2.r.2I,2.r.2G),o j.3.1s(2.r.2D,2.r.2E));2.N=o j.3.2Z();j.3.14.19(2.N,\'37\',8(){$(\'2W\').T($(\'#2F\'));2.N.2u(\'\');$(\'#17\').2K()});$.2y({2z:"2J",2L:"1l/1B/2O.1T",2N:z,1j:{2x:"2w.3.3a",34:2.2X,3G:\'n\'},2H:8(1b){2.1P=1b;P(u i=0;i<2.3.E;i++){1J(\'2C\',i)}}});P(u i=0;i<2.3.E;i++){2B(2.3[i],i);9(2.3[i].3V==\'A\'){$(\'#\'+2.3[i].q).m({12:($(18).12()*2.2M)+\'2k\',13:($(18).13()*2.2M)+\'2k\'})}$(\'#\'+2.3[i].q+\'22\').R({3K:v,12:\'1Y\',13:\'1Y\',3S:z,3Q:\'X\',3I:\'1h\',S:2.3[i].S,1i:8(){1J(\'1i\',$(W).1j(\'b\'))}}).1j(\'b\',i);9(2.1X){$(\'11.1h 11.1g-R-1K\').T(\'<a 1N="#" q="1d" 1M="p:O;" 1V="Y(2.r, \'+i+\'); $(W).m(\\\'p\\\', \\\'O\\\').2m(); L(v);">\'+\'<t>&3E;</t></a>\');$(\'#1d\').1I(\'S\',2.1O.47)}9(2.3[i].k.I!=D){$(\'11.1h 11.1g-R-1K\').T(\'<a 1N="#" q="1e" 1V="Y(2.3[\'+i+\'].k.I.25(), \'+i+\'); $(W).m(\\\'p\\\', \\\'O\\\').2m(); L(v);">\'+\'<t>&3X;</t></a>\');$(\'#1e\').1I(\'S\',2.1O.42)}$(\'11.1h 11.1g-R-1K\').T(\'<t q="1L" 1M="p:O;"><2j 2i="./1l/2V/3b/3q.3r"><t>\'+2.1O.3s+\'</t></t>\');$(\'#1g-R-S-3f\').T(\'<t q="1Q"></t>\')}});',62,259,'||gmaps|maps||map|currentInfo|mapIndex|function|if||index||||marker|markers|||google|gMap|properties|css||new|display|id|bounds|displayed|span|var|false||||true||iM|else|null|length|info||uId|kmlFile|html|imgTn|return|tmp|infoWindow|none|for|callId|dialog|title|append||inline|this||fitToBounds|markerImg||div|width|height|event||markerImgProp|ciGMIWC_img|window|addListener|loadMarkers|msg|displayPictureInfo|gmapsBoundMap|gmapsBoundKml|datas|ui|gmapsPopup|open|data|getBounds|plugins|gmapsIndex|imgCatsUrl|lng|lat|mapTypeControl|loadIndex|LatLng|newListIndex|m2|nbImg|renameId|nbImgTxt|bind|ciGMIWC_showcat|zoomLevel|GMaps|viewportInitialized|block|markerList|navigationControl|m1|mode|attr|initializeMapViewport|titlebar|gmapsLoading|style|href|lang|requestId|gmapsNbPhotos|each|uniqueId|php|get|onclick|ciGMIWC_title|geolocated|auto|ciWALeft||ciWARight|Content|ciGMIWC_picnum|li|getDefaultViewport|click|ciGMIWC_showcatList|imgName|break|getNorthEast|getSouthWest|getDiv|Point|re|scaleControl|streetViewControl|kmlFileUrl|src|img|px|compareMarkers|blur|substr|case|applyMarkers|setMap|splice|markerInList|displayWindowInfo|setContent|close|public|ajaxfct|ajax|type|getCenter|createMap|loaded|north|east|iGMapsInfoWindowContent|west|success|south|POST|unbind|url|popupAutomaticSize|async|gmaps_ajax|getMarkers|sort|mapType|mapTypeId|ffffff|parseJSON|GrumPluginClasses|body|categoryId|Map|InfoWindow||||getZoom|category|while|backgroundColor|closeclick|nbPhotos||init|icons|distanceTreshold|Number|MarkerImage|iGMapsIconContent|exec|markerTitle|preserveViewport|mS|_|Size|mapTypeControlOptions|scrollwheel|center|KmlLayer|processing|gif|loading|position|Array|zoom|Marker|font|size|imgCatsNames|resize|mouseenter|location|55|there4|nbsp|mapId|setCenter|dialogClass|mouseleave|autoOpen|setZoom|fitBounds|zoomLevelMaxActivated|displayPictureNext|displayPicturePrev|closeText|trigger|modal|isOpen|dragend|sizeMode|galleries|sim|LatLngBounds|charAt||switch|boundkml|setIcon|push|load|upload|boundmap|clone|children|zoom_changed'.split('|'),0,{}))
     1/* file: gmapsCategory.js - v1.2.0 | packed on 2010/11/04 with http://joliclic.free.fr/php/javascript-packer/ */
     2eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('u 14=[B,{w:32,h:32,x:15,y:31},{w:32,h:32,x:15,y:31},{w:32,h:32,x:10,y:31},{w:30,h:40,x:4,y:39},];9 2E(l,1d){u 5=m j.3.2W($("#"+l.q).2d(0),{2V:\'#2Z\',34:l.2U,35:l.1p,2O:2.s.1X(),1s:(l.1s==-1)?v:z,2Q:(l.1s==-1)?v:z,2r:(l.2r==\'n\')?v:z,2z:(l.2z==\'n\')?v:z,1K:(l.1K==-1)?v:z,3h:{1t:l.1K},3f:\'\',});7(l.2i!=\'\'){H=m j.3.38(l.2i,{3a:z});H.24(5)}F{H=B}2A=/^3b(\\d\\d)2T.*/i;E=2A.3j(l.Q);7(E!=B)E=m 2S(E[1]);7(E!=B){5.Q=m j.3.3g(\'1h/1H/2t/\'+l.Q,m j.3.3c(14[E].w,14[E].h),m j.3.2e(0,0),m j.3.2e(14[E].x,14[E].y))}F{5.Q=B}5.H=H;5.f=m 2P();5.1d=1d;5.1v=v;5.Y=0;l.k=5}9 1e(5){5.Y++;1c={1q:2.1q,Y:5.Y,s:{2F:5.1l().2j().1I(),2C:5.1l().2j().1N(),2I:5.1l().1T().1I(),2G:5.1l().1T().1N()},17:$(5.1S()).17(),12:$(5.1S()).12(),2R:20,1r:5.1d,};$(\'#1z\').o(\'p\',\'S-1G\');$(\'#1w\').M(\'\');$.2l({2m:"2n",2o:"1h/1H/2k.2B",2f:z,1O:{2g:"2h.3.33",1c:1c},2p:9(1f){L=$.36(1f);7(2.3[L.1r].k.Y==L.Y){L.f.37(21);2a(2.3[L.1r].k,L.f);$(\'#1z\').o(\'p\',\'K\');$(\'#1w\').M(\'[\'+L.1c.3k+\']\')}}})}9 2a(5,f){7(5.f.C>0){u i=0;3i(i<5.f.C){1L=2c(5.f[i].I,f);7(1L==-1){5.f[i].g.24(B);5.f.27(i,1)}F{f.27(1L,1);i++}}}W(u i=0;i<f.C;i++){u g=m j.3.3e({3l:m j.3.1x(f[i].1I,f[i].1N),5:5,R:f[i].1P});7(5.Q!=B)g.3m(5.Q);g.D=f[i];g.D.r=0;5.f.2Y({g:g,I:f[i].I});j.3.16.19(g,\'22\',9(){25(Z)});W(u b=0;b<g.D.J.C;b++){2X(g.D.J[b].3d(0)){1Y\'G\':g.D.J[b]=\'./3W/\'+g.D.J[b].1Q(1);1R;1Y\'U\':g.D.J[b]=\'./3X/\'+g.D.J[b].1Q(1);1R}}}}9 21(1B,1A){7(1B.I<1A.I){N(-1)}F 7(1B.I<1A.I){N(1)}N(0)}9 2c(26,1n){W(u i=0;i<1n.C;i++){7(1n[i].I==26)N(i)}N(-1)}9 25(g){2.6=g.D;2.O.2H();2.O.2K($(\'#3Y\').3Z().1W(1J).2d(0));2.O.1M(g.5,g);1b(2.6.r)}9 1J(i,e){7(e.q!=\'\')e.q=\'c\'+e.q;$(e).3V().1W(1J)}9 1b(b){2.6.r=b;7(2.6.1U[b]==\'\'){$(\'#1V\').M(\'&3U;\')}F{$(\'#1V\').M(2.6.1U[b])}$(\'#11\').1m(\'2u\',2.6.J[b]);$(\'#11\').2D();7(2.6.18[b].C==1){$(\'#11\').1E(\'22\',9(){1a.3Q=2.6.18[2.6.r][0]})}F{$(\'#2b\').M(\'\');W(u i=0;i<2.6.18[b].C;i++){$(\'#2b\').13(\'<23><a 1D="\'+2.6.18[b][i]+\'">\'+2.6.3P[b][i]+\'</a></23>\')}$(\'#11, #1F\').1E(\'3R\',9(){$(\'#1F\').o(\'p\',\'1G\')}).1E(\'3S\',9(){$(\'#1F\').o(\'p\',\'K\')})}7(2.6.1o>1){$(\'#29\').M((b+1)+\'/\'+2.6.1P);$(\'#1Z, #28\').o(\'p\',\'S-1G\')}F{$(\'#29\').M(2.6.1P);$(\'#1Z, #28\').o(\'p\',\'K\')}}9 3T(){2.6.r--;7(2.6.r<0)2.6.r=2.6.1o-1;1b(2.6.r)}9 42(){2.6.r++;7(2.6.r>=2.6.1o)2.6.r=0;1b(2.6.r)}9 T(s,8){2.3[8].k.41(s);7(2.3[8].46&&2.3[8].k.48()>2.3[8].1p){2.3[8].k.49(2.3[8].1p)}}9 2q(1y,8){7(8>-1&&($(\'#\'+2.3[8].q+\'2L\').P(\'3n\')&&1y==\'2x\'||1y==\'1M\')&&(2.3[8].k.1v==v)){j.3.16.47(2.3[8].k,\'43\');$(\'#\'+2.3[8].q+\' t, #\'+2.3[8].q+\' a\').o(\'44-45\',\'3N.0%\');7(2.2y){7(2.3[8].T){T(2.s,8)}F{2.3[8].k.3O(2.s.1X())}}F{T(2.3[8].k.H.2v(),8)}j.3.16.19(2.3[8].k,\'3w\',9(){1e(Z);$(\'#1i\').o(\'p\',\'S\');$(\'#1k\').o(\'p\',\'S\')});j.3.16.19(2.3[8].k,\'3v\',9(){1e(Z);2.O.2H();$(\'#1i\').o(\'p\',\'S\');$(\'#1k\').o(\'p\',\'S\')});2.3[8].k.1v=z;1e(2.3[8].k)}}$(1a).3x(9(){2.6=B;2.s=m j.3.3y(m j.3.1x(2.s.2I,2.s.2G),m j.3.1x(2.s.2F,2.s.2C));2.O=m j.3.3z();j.3.16.19(2.O,\'3u\',9(){2.O.2K(\'\');$(\'#11\').2D()});W(u i=0;i<2.3.C;i++){2E(2.3[i],i);7(2.3[i].3t==\'A\'){$(\'#\'+2.3[i].q).o({17:($(1a).17()*2.2J)+\'2M\',12:($(1a).12()*2.2J)+\'2M\'})}$(\'#\'+2.3[i].q+\'2L\').P({3q:v,17:\'2N\',12:\'2N\',3r:z,3s:\'X\',3B:\'1g\',R:2.3[i].R,1M:9(){$.2l({2m:"2n",2o:"1h/1H/2k.2B",2f:z,1O:{2g:"2h.3.3K",3L:2.3M,3I:\'n\'},2p:9(1f){2.1q=1f;W(u i=0;i<2.3.C;i++){2q(\'2x\',i)}}})}}).1O(\'b\',i);7(2.2y){$(\'V.1g V.1j-P-1C\').13(\'<a 1D="#" q="1i" 1t="p:K;" 2w="T(2.s, \'+i+\'); $(Z).o(\\\'p\\\', \\\'K\\\').2s(); N(v);">\'+\'<t>&3C;</t></a>\');$(\'#1i\').1m(\'R\',2.1u.3E)}7(2.3[i].k.H!=B){$(\'V.1g V.1j-P-1C\').13(\'<a 1D="#" q="1k" 2w="T(2.3[\'+i+\'].k.H.2v(), \'+i+\'); $(Z).o(\\\'p\\\', \\\'K\\\').2s(); N(v);">\'+\'<t>&3G;</t></a>\');$(\'#1k\').1m(\'R\',2.1u.3F)}$(\'V.1g V.1j-P-1C\').13(\'<t q="1z" 1t="p:K;"><2t 2u="./1h/3D/3H/3J.3A"><t>\'+2.1u.3o+\'</t></t>\');$(\'#1j-P-R-3p\').13(\'<t q="1w"></t>\')}});',62,258,'||gmaps|maps||map|currentInfo|if|mapIndex|function||index||||markers|marker|||google|gMap|properties|new||css|display|id|displayed|bounds|span|var|false||||true||null|length|info|iM|else||kmlFile|uId|imgTn|none|tmp|html|return|infoWindow|dialog|markerImg|title|inline|fitToBounds||div|for||callId|this||ciGMIWC_img|height|append|markerImgProp||event|width|imgCatsUrl|addListener|window|displayPictureInfo|datas|gmapsIndex|loadMarkers|msg|gmapsPopup|plugins|gmapsBoundMap|ui|gmapsBoundKml|getBounds|attr|markerList|nbImg|zoomLevel|requestId|loadIndex|navigationControl|style|lang|viewportInitialized|gmapsNbPhotos|LatLng|mode|gmapsLoading|m2|m1|titlebar|href|bind|ciGMIWC_showcat|block|GMaps|lat|renameId|mapTypeControl|newListIndex|open|lng|data|nbImgTxt|substr|break|getDiv|getSouthWest|imgName|ciGMIWC_title|each|getCenter|case|ciWALeft||compareMarkers|click|li|setMap|displayWindowInfo|uniqueId|splice|ciWARight|ciGMIWC_picnum|applyMarkers|ciGMIWC_showcatList|markerInList|get|Point|async|ajaxfct|public|kmlFileUrl|getNorthEast|gmaps_ajax|ajax|type|POST|url|success|initializeMapViewport|scaleControl|blur|img|src|getDefaultViewport|onclick|loaded|geolocated|streetViewControl|re|php|east|unbind|createMap|north|west|close|south|popupAutomaticSize|setContent|Content|px|auto|center|Array|scrollwheel|distanceTreshold|Number|_|mapType|backgroundColor|Map|switch|push|ffffff||||getMarkers|mapTypeId|zoom|parseJSON|sort|KmlLayer||preserveViewport|mS|Size|charAt|Marker|markerTitle|MarkerImage|mapTypeControlOptions|while|exec|nbPhotos|position|setIcon|isOpen|loading|iGMapsIconContent|autoOpen|modal|closeText|sizeMode|closeclick|zoom_changed|dragend|load|LatLngBounds|InfoWindow|gif|dialogClass|there4|GrumPluginClasses|boundmap|boundkml|sim|icons|mapId|processing|init|category|categoryId|55|setCenter|imgCatsNames|location|mouseenter|mouseleave|displayPicturePrev|nbsp|children|galleries|upload|iGMapsInfoWindowContent|clone||fitBounds|displayPictureNext|resize|font|size|zoomLevelMaxActivated|trigger|getZoom|setZoom'.split('|'),0,{}))
  • extensions/GMaps/js/gmapsMarkup.js

    r7500 r7616  
    22 * -----------------------------------------------------------------------------
    33 * file: gmapsMarkup.js
    4  * file version: 1.0.0
    5  * date: 2010-10-28
     4 * file version: 1.1.0
     5 * date: 2010-11-04
    66 */
    77
    88var markerImgProp = [
    9   null,
    10   { w:32, h:32, x:15, y:31 }, // s01
    11   { w:32, h:32, x:15, y:31 }, // s02
    12   { w:32, h:32, x:10, y:31 }, // s03
    13   { w:30, h:40, x:4, y:39 }, // s04
    14 ];
    15 
    16 
    17 /**
    18  * create the map
    19  *
    20  * @param Object properties : map properties
    21  * @param Integer gmapsIndex : index in the map list
    22  */
    23 function createMap(properties, gmapsIndex)
     9      null,
     10      { w:32, h:32, x:15, y:31 }, // s01
     11      { w:32, h:32, x:15, y:31 }, // s02
     12      { w:32, h:32, x:10, y:31 }, // s03
     13      { w:30, h:40, x:4, y:39 }, // s04
     14    ];
     15
     16
     17function markupMaps()
    2418{
    25   var bounds = new google.maps.LatLngBounds(
    26         new google.maps.LatLng(properties.mapBounds.south, properties.mapBounds.west),
    27         new google.maps.LatLng(properties.mapBounds.north, properties.mapBounds.east)
    28       ),
    29       map = new google.maps.Map($("#"+properties.id).get(0),
    30         {
    31           backgroundColor:'#ffffff',
    32           mapTypeId: properties.mapType,
    33           zoom: properties.zoomLevel,
    34           center: bounds.getCenter(),
    35           navigationControl: (properties.navigationControl==-1)?false:true,
    36           scrollwheel: (properties.navigationControl==-1)?false:true,
    37           scaleControl: (properties.scaleControl=='n')?false:true,
    38           streetViewControl: (properties.streetViewControl=='n')?false:true,
    39           mapTypeControl:(properties.mapTypeControl==-1)?false:true,
    40           mapTypeControlOptions:
     19  /**
     20   * create the map
     21   *
     22   * @param Object properties : map properties
     23   * @param Integer gmapsIndex : index in the map list
     24   */
     25  this.createMap = function (properties, gmapsIndex)
     26  {
     27    var bounds = new google.maps.LatLngBounds(
     28          new google.maps.LatLng(properties.mapBounds.south, properties.mapBounds.west),
     29          new google.maps.LatLng(properties.mapBounds.north, properties.mapBounds.east)
     30        ),
     31        map = new google.maps.Map($("#"+properties.id).get(0),
     32          {
     33            backgroundColor:'#ffffff',
     34            mapTypeId: properties.mapType,
     35            zoom: properties.zoomLevel,
     36            center: bounds.getCenter(),
     37            navigationControl: (properties.navigationControl==-1)?false:true,
     38            scrollwheel: (properties.navigationControl==-1)?false:true,
     39            scaleControl: (properties.scaleControl=='n')?false:true,
     40            streetViewControl: (properties.streetViewControl=='n')?false:true,
     41            mapTypeControl:(properties.mapTypeControl==-1)?false:true,
     42            mapTypeControlOptions:
     43              {
     44                style:properties.mapTypeControl
     45              },
     46            markerTitle:'',
     47          }
     48        );
     49
     50    if(properties.kmlFileUrl!='')
     51    {
     52      kmlFile = new google.maps.KmlLayer(properties.kmlFileUrl,
     53        {
     54          preserveViewport:true
     55        }
     56      );
     57      kmlFile.setMap(map);
     58    }
     59    else
     60    {
     61      kmlFile=null;
     62    }
     63
     64    re=/^mS(\d\d)_.*/i;
     65    iM=re.exec(properties.markerImg);
     66    if(iM!=null) iM=new Number(iM[1]);
     67
     68    if(iM!=null)
     69    {
     70      map.markerImg = new google.maps.MarkerImage('plugins/GMaps/img/'+properties.markerImg,
     71          new google.maps.Size(markerImgProp[iM].w, markerImgProp[iM].h),
     72          new google.maps.Point(0,0),
     73          new google.maps.Point(markerImgProp[iM].x, markerImgProp[iM].y));
     74    }
     75    else
     76    {
     77      map.markerImg = null;
     78    }
     79
     80    map.bounds=bounds;
     81    map.kmlFile=kmlFile;
     82    map.markers=new Array();
     83    map.gmapsIndex=gmapsIndex;
     84    map.width=properties.width;
     85    map.height=properties.height;
     86    map.callId=0;
     87    map.allowBubble=properties.allowBubble;
     88    map.initialized=false;
     89    properties.gMap=map;
     90
     91
     92    if(properties.geolocated)
     93    {
     94      if(properties.fitToBounds)
     95      {
     96        fitToBounds(map.bounds, gmapsIndex);
     97      }
     98      else
     99      {
     100        map.setCenter(map.bounds.getCenter());
     101      }
     102    }
     103
     104    if(properties.markerVisible)
     105    {
     106      loadMarkers(map);
     107    }
     108    else
     109    {
     110      initializeMapViewport(gmapsIndex);
     111    }
     112  };
     113
     114  /**
     115   * load markers from the server
     116   *
     117   * @param Map map : the map
     118   */
     119  var loadMarkers = function(map)
     120  {
     121    if(map.getBounds()==null) return(false);
     122    map.callId++;
     123
     124    datas={
     125      requestId:gmapsMarkup.requestId,
     126      callId:map.callId,
     127      bounds:{
     128          north:map.getBounds().getNorthEast().lat(),
     129          east:map.getBounds().getNorthEast().lng(),
     130          south:map.getBounds().getSouthWest().lat(),
     131          west:map.getBounds().getSouthWest().lng()
     132        },
     133      width:map.width,
     134      height:map.height,
     135      distanceTreshold:20,
     136      loadIndex:map.gmapsIndex,
     137    };
     138
     139    $.ajax(
     140      {
     141        type: "POST",
     142        url: "plugins/GMaps/gmaps_ajax.php",
     143        async: true,
     144        data: { ajaxfct:"public.maps.getMarkers", datas:datas },
     145        success:
     146          function(msg)
     147          {
     148            tmp=$.parseJSON(msg);
     149            if(gmapsMarkup.maps[tmp.loadIndex].gMap.callId==tmp.callId)
    41150            {
    42               style:properties.mapTypeControl
    43             },
    44           markerTitle:'',
     151              tmp.markers.sort(compareMarkers);
     152              applyMarkers(gmapsMarkup.maps[tmp.loadIndex].gMap, tmp.markers);
     153              initializeMapViewport(tmp.loadIndex);
     154            }
     155          }
     156      }
     157    );
     158  };
     159
     160  /**
     161   * apply markers to map
     162   *
     163   * @param Map map : the google map object
     164   * @param Array markers : array of markers properties
     165   *                        each marker is an object with properties :
     166   *                          latitude, longitude, nbImg
     167   */
     168  var applyMarkers = function(map, markers)
     169  {
     170    if(map==null) return(false);
     171
     172    /*
     173     * deleting markers from the map only if they are not in the new list
     174     */
     175    if(map.markers.length>0)
     176    {
     177      var i=0;
     178      while(i<map.markers.length)
     179      {
     180        newListIndex=markerInList(map.markers[i].uId, markers);
     181        if(newListIndex==-1)
     182        {
     183          map.markers[i].marker.setMap(null);
     184          map.markers.splice(i, 1);
     185        }
     186        else
     187        {
     188          markers.splice(newListIndex,1);
     189          i++;
     190        }
     191      }
     192    }
     193
     194    /*
     195     * add new markers on the map
     196     */
     197    for(var i=0;i<markers.length;i++)
     198    {
     199      var marker = new google.maps.Marker(
     200        {
     201          position:new google.maps.LatLng(markers[i].lat, markers[i].lng),
     202          map: map,
     203          title:markers[i].nbImgTxt
    45204        }
    46205      );
    47206
    48   if(properties.kmlFileUrl!='')
    49   {
    50     kmlFile = new google.maps.KmlLayer(properties.kmlFileUrl,
    51       {
    52         preserveViewport:true
    53       }
    54     );
    55     kmlFile.setMap(map);
    56   }
    57   else
    58   {
    59     kmlFile=null;
    60   }
    61 
    62   re=/^mS(\d\d)_.*/i;
    63   iM=re.exec(properties.markerImg);
    64   if(iM!=null) iM=new Number(iM[1]);
    65 
    66   if(iM!=null)
    67   {
    68     map.markerImg = new google.maps.MarkerImage('plugins/GMaps/img/'+properties.markerImg,
    69         new google.maps.Size(markerImgProp[iM].w, markerImgProp[iM].h),
    70         new google.maps.Point(0,0),
    71         new google.maps.Point(markerImgProp[iM].x, markerImgProp[iM].y));
    72   }
    73   else
    74   {
    75     map.markerImg = null;
    76   }
    77 
    78   map.bounds=bounds;
    79   map.kmlFile=kmlFile;
    80   map.markers=new Array();
    81   map.gmapsIndex=gmapsIndex;
    82   map.width=properties.width;
    83   map.height=properties.height;
    84   map.callId=0;
    85   map.allowBubble=properties.allowBubble;
    86   map.initialized=false;
    87   properties.gMap=map;
    88 
    89 
    90   if(properties.geolocated)
    91   {
    92     if(properties.fitToBounds)
    93     {
    94       fitToBounds(map.bounds, gmapsIndex);
     207      if(map.markerImg!=null) marker.setIcon(map.markerImg);
     208
     209      marker.info=markers[i];
     210      marker.info.displayed=0;
     211
     212      map.markers.push(
     213        {
     214          marker:marker,
     215          uId:markers[i].uId
     216        }
     217      );
     218
     219      if(map.allowBubble)
     220      {
     221        google.maps.event.addListener(
     222          marker,
     223          'click',
     224          function ()
     225          {
     226            displayWindowInfo(this);
     227          }
     228        );
     229      }
     230
     231      for(var index=0;index<marker.info.imgTn.length;index++)
     232      {
     233        switch(marker.info.imgTn[index].charAt(0))
     234        {
     235          case 'G':
     236            marker.info.imgTn[index]='./galleries/'+marker.info.imgTn[index].substr(1);
     237            break;
     238          case 'U':
     239            marker.info.imgTn[index]='./upload/'+marker.info.imgTn[index].substr(1);
     240            break;
     241        }
     242      }
     243    }
     244  };
     245
     246  var compareMarkers=function(m1,m2)
     247  {
     248    if(m1.uId<m2.uId)
     249    {
     250      return(-1);
     251    }
     252    else if(m1.uId<m2.uId)
     253    {
     254      return(1);
     255    }
     256    return(0);
     257  };
     258
     259  var markerInList=function(uniqueId, markerList)
     260  {
     261    for(var i=0;i<markerList.length;i++)
     262    {
     263      if(markerList[i].uId==uniqueId) return(i)
     264    }
     265    return(-1);
     266  };
     267
     268  /**
     269   * display the infowindow
     270   *
     271   * @param Marker marker : the marker
     272   */
     273  var displayWindowInfo=function(marker)
     274  {
     275    gmapsMarkup.currentInfo=marker.info;
     276    gmapsMarkup.infoWindow.close();
     277    gmapsMarkup.infoWindow.setContent($('#iGMapsInfoWindowContent').clone().each(renameId).get(0));
     278    gmapsMarkup.infoWindow.open(marker.map, marker);
     279    displayPictureInfo(gmapsMarkup.currentInfo.displayed);
     280  };
     281  var renameId=function(i, e)
     282  {
     283    if(e.id!='') e.id='c'+e.id;
     284    $(e).children().each(renameId);
     285  };
     286
     287
     288  /**
     289   *
     290   */
     291  var displayPictureInfo=function(index)
     292  {
     293    gmapsMarkup.currentInfo.displayed=index;
     294    if(gmapsMarkup.currentInfo.imgName[index]=='')
     295    {
     296      $('#ciGMIWC_title').html('&nbsp;');
    95297    }
    96298    else
    97299    {
    98       map.setCenter(map.bounds.getCenter());
    99     }
    100   }
    101 
    102   if(properties.markerVisible)
    103   {
    104     loadMarkers(map);
    105   }
    106   else
    107   {
    108     initializeMapViewport(gmapsIndex);
    109   }
     300      $('#ciGMIWC_title').html(gmapsMarkup.currentInfo.imgName[index]);
     301    }
     302    $('#ciGMIWC_img').attr('src', gmapsMarkup.currentInfo.imgTn[index]);
     303
     304    $('#ciGMIWC_img').unbind();
     305    if(gmapsMarkup.currentInfo.imgCatsUrl[index].length==1)
     306    {
     307      $('#ciGMIWC_img').bind('click',
     308        function ()
     309        {
     310          window.location=gmapsMarkup.currentInfo.imgCatsUrl[gmapsMarkup.currentInfo.displayed][0];
     311        }
     312      );
     313    }
     314    else
     315    {
     316      $('#ciGMIWC_showcatList').html('');
     317      for(var i=0;i<gmapsMarkup.currentInfo.imgCatsUrl[index].length;i++)
     318      {
     319        $('#ciGMIWC_showcatList')
     320          .append('<li><a href="'+gmapsMarkup.currentInfo.imgCatsUrl[index][i]+'">'+gmapsMarkup.currentInfo.imgCatsNames[index][i]+'</a></li>');
     321      }
     322      $('#ciGMIWC_img, #ciGMIWC_showcat')
     323        .bind('mouseenter', function () { $('#ciGMIWC_showcat').css('display', 'block'); } )
     324        .bind('mouseleave', function () { $('#ciGMIWC_showcat').css('display', 'none'); } );
     325    }
     326
     327    if(gmapsMarkup.currentInfo.nbImg>1)
     328    {
     329      $('#ciGMIWC_picnum').html((index+1)+'/'+gmapsMarkup.currentInfo.nbImgTxt);
     330      $('#ciWALeft, #ciWARight').css('display', 'inline-block');
     331    }
     332    else
     333    {
     334      $('#ciGMIWC_picnum').html(gmapsMarkup.currentInfo.nbImgTxt);
     335      $('#ciWALeft, #ciWARight').css('display', 'none');
     336    }
     337  };
     338
     339  /**
     340   *
     341   */
     342  this.displayPicturePrev=function()
     343  {
     344    gmapsMarkup.currentInfo.displayed--;
     345    if(gmapsMarkup.currentInfo.displayed<0) gmapsMarkup.currentInfo.displayed=gmapsMarkup.currentInfo.nbImg-1;
     346    displayPictureInfo(gmapsMarkup.currentInfo.displayed);
     347  };
     348
     349  /**
     350   *
     351   */
     352  this.displayPictureNext=function()
     353  {
     354    gmapsMarkup.currentInfo.displayed++;
     355    if(gmapsMarkup.currentInfo.displayed>=gmapsMarkup.currentInfo.nbImg) gmapsMarkup.currentInfo.displayed=0;
     356    displayPictureInfo(gmapsMarkup.currentInfo.displayed);
     357  };
     358
     359
     360  /**
     361   * check if zoomLevel
     362   */
     363  var fitToBounds=function(bounds, mapIndex)
     364  {
     365    gmapsMarkup.maps[mapIndex].gMap.fitBounds(bounds);
     366
     367    if(gmapsMarkup.maps[mapIndex].zoomLevelMaxActivated &&
     368       gmapsMarkup.maps[mapIndex].gMap.getZoom() > gmapsMarkup.maps[mapIndex].zoomLevel)
     369    {
     370      gmapsMarkup.maps[mapIndex].gMap.setZoom(gmapsMarkup.maps[mapIndex].zoomLevel);
     371    }
     372  };
     373
     374  var initializeMapViewport=function(mapIndex)
     375  {
     376    if(mapIndex>-1 && !gmapsMarkup.maps[mapIndex].gMap.initialized)
     377    {
     378      // reduce copyright size... ^_^
     379      $('#'+gmapsMarkup.maps[mapIndex].id+' span, #'+gmapsMarkup.maps[mapIndex].id+' a').css('font-size', '55.0%');
     380
     381      if(gmapsMarkup.maps[mapIndex].markerVisible)
     382      {
     383        google.maps.event.addListener(
     384          gmapsMarkup.maps[mapIndex].gMap,
     385          'dragend',
     386          function()
     387          {
     388            loadMarkers(this);
     389          }
     390        );
     391
     392        google.maps.event.addListener(
     393          gmapsMarkup.maps[mapIndex].gMap,
     394          'zoom_changed',
     395          function()
     396          {
     397            loadMarkers(this);
     398            gmapsMarkup.infoWindow.close();
     399          }
     400        );
     401      }
     402
     403
     404      if(gmapsMarkup.maps[mapIndex].kmlZoom && gmapsMarkup.maps[mapIndex].gMap.kmlFile!=null)
     405      {
     406        google.maps.event.addListenerOnce(
     407          gmapsMarkup.maps[mapIndex].gMap.kmlFile,
     408          'defaultviewport_changed',
     409          function()
     410          {
     411            fitToBounds(gmapsMarkup.maps[mapIndex].gMap.kmlFile.getDefaultViewport(), mapIndex);
     412          }
     413        );
     414
     415      }
     416
     417      gmapsMarkup.maps[mapIndex].gMap.initialized=true;
     418    }
     419  };
     420
    110421}
    111422
    112 /**
    113  * load markers from the server
    114  *
    115  * @param Map map : the map
    116  */
    117 function loadMarkers(map)
    118 {
    119   if(map.getBounds()==null) return(false);
    120   map.callId++;
    121 
    122   datas={
    123     requestId:gmapsMarkup.requestId,
    124     callId:map.callId,
    125     bounds:{
    126         north:map.getBounds().getNorthEast().lat(),
    127         east:map.getBounds().getNorthEast().lng(),
    128         south:map.getBounds().getSouthWest().lat(),
    129         west:map.getBounds().getSouthWest().lng()
    130       },
    131     width:map.width,
    132     height:map.height,
    133     distanceTreshold:20,
    134     loadIndex:map.gmapsIndex,
    135   };
    136 
    137   $.ajax(
    138     {
    139       type: "POST",
    140       url: "plugins/GMaps/gmaps_ajax.php",
    141       async: true,
    142       data: { ajaxfct:"public.maps.getMarkers", datas:datas },
    143       success:
    144         function(msg)
    145         {
    146           tmp=$.parseJSON(msg);
    147           if(gmaps.maps[tmp.loadIndex].gMap.callId==tmp.callId)
    148           {
    149             tmp.markers.sort(compareMarkers);
    150             applyMarkers(gmapsMarkup.maps[tmp.loadIndex].gMap, tmp.markers);
    151             initializeMapViewport(tmp.loadIndex);
    152           }
    153         }
    154     }
    155   );
    156 }
    157 
    158 /**
    159  * apply markers to map
    160  *
    161  * @param Map map : the google map object
    162  * @param Array markers : array of markers properties
    163  *                        each marker is an object with properties :
    164  *                          latitude, longitude, nbImg
    165  */
    166 function applyMarkers(map, markers)
    167 {
    168   if(map==null) return(false);
    169 
    170   /*
    171    * deleting markers from the map only if they are not in the new list
    172    */
    173   if(map.markers.length>0)
    174   {
    175     var i=0;
    176     while(i<map.markers.length)
    177     {
    178       newListIndex=markerInList(map.markers[i].uId, markers);
    179       if(newListIndex==-1)
    180       {
    181         map.markers[i].marker.setMap(null);
    182         map.markers.splice(i, 1);
    183       }
    184       else
    185       {
    186         markers.splice(newListIndex,1);
    187         i++;
    188       }
    189     }
    190   }
    191 
    192   /*
    193    * add new markers on the map
    194    */
    195   for(var i=0;i<markers.length;i++)
    196   {
    197     var marker = new google.maps.Marker(
    198       {
    199         position:new google.maps.LatLng(markers[i].lat, markers[i].lng),
    200         map: map,
    201         title:markers[i].nbImgTxt
    202       }
    203     );
    204 
    205     if(map.markerImg!=null) marker.setIcon(map.markerImg);
    206 
    207     marker.info=markers[i];
    208     marker.info.displayed=0;
    209 
    210     map.markers.push(
    211       {
    212         marker:marker,
    213         uId:markers[i].uId
    214       }
    215     );
    216 
    217     if(map.allowBubble)
    218     {
    219       google.maps.event.addListener(
    220         marker,
    221         'click',
    222         function ()
    223         {
    224           displayWindowInfo(this);
    225         }
    226       );
    227     }
    228 
    229     for(var index=0;index<marker.info.imgTn.length;index++)
    230     {
    231       switch(marker.info.imgTn[index].charAt(0))
    232       {
    233         case 'G':
    234           marker.info.imgTn[index]='./galleries/'+marker.info.imgTn[index].substr(1);
    235           break;
    236         case 'U':
    237           marker.info.imgTn[index]='./upload/'+marker.info.imgTn[index].substr(1);
    238           break;
    239       }
    240     }
    241   }
    242 }
    243 
    244 function compareMarkers(m1,m2)
    245 {
    246   if(m1.uId<m2.uId)
    247   {
    248     return(-1);
    249   }
    250   else if(m1.uId<m2.uId)
    251   {
    252     return(1);
    253   }
    254   return(0);
    255 }
    256 
    257 function markerInList(uniqueId, markerList)
    258 {
    259   for(var i=0;i<markerList.length;i++)
    260   {
    261     if(markerList[i].uId==uniqueId) return(i)
    262   }
    263   return(-1);
    264 }
    265 
    266 /**
    267  * display the infowindow
    268  *
    269  * @param Marker marker : the marker
    270  */
    271 function displayWindowInfo(marker)
    272 {
    273   gmapsMarkup.currentInfo=marker.info;
    274   gmapsMarkup.infoWindow.close();
    275   gmapsMarkup.infoWindow.setContent($('#iGMapsInfoWindowContent').clone().each(renameId).get(0));
    276   gmapsMarkup.infoWindow.open(marker.map, marker);
    277   displayPictureInfo(gmapsMarkup.currentInfo.displayed);
    278 }
    279 function renameId(i, e)
    280 {
    281   if(e.id!='') e.id='c'+e.id;
    282   $(e).children().each(renameId);
    283 }
    284 
    285 
    286 /**
    287  *
    288  */
    289 function displayPictureInfo(index)
    290 {
    291   gmapsMarkup.currentInfo.displayed=index;
    292   if(gmapsMarkup.currentInfo.imgName[index]=='')
    293   {
    294     $('#ciGMIWC_title').html('&nbsp;');
    295   }
    296   else
    297   {
    298     $('#ciGMIWC_title').html(gmapsMarkup.currentInfo.imgName[index]);
    299   }
    300   $('#ciGMIWC_img').attr('src', gmapsMarkup.currentInfo.imgTn[index]);
    301 
    302   $('#ciGMIWC_img').unbind();
    303   if(gmapsMarkup.currentInfo.imgCatsUrl[index].length==1)
    304   {
    305     $('#ciGMIWC_img').bind('click',
    306       function ()
    307       {
    308         window.location=gmapsMarkup.currentInfo.imgCatsUrl[gmapsMarkup.currentInfo.displayed][0];
    309       }
    310     );
    311   }
    312   else
    313   {
    314     $('#ciGMIWC_showcatList').html('');
    315     for(var i=0;i<gmapsMarkup.currentInfo.imgCatsUrl[index].length;i++)
    316     {
    317       $('#ciGMIWC_showcatList')
    318         .append('<li><a href="'+gmapsMarkup.currentInfo.imgCatsUrl[index][i]+'">'+gmapsMarkup.currentInfo.imgCatsNames[index][i]+'</a></li>');
    319     }
    320     $('#ciGMIWC_img, #ciGMIWC_showcat')
    321       .bind('mouseenter', function () { $('#ciGMIWC_showcat').css('display', 'block'); } )
    322       .bind('mouseleave', function () { $('#ciGMIWC_showcat').css('display', 'none'); } );
    323   }
    324 
    325   if(gmapsMarkup.currentInfo.nbImg>1)
    326   {
    327     $('#ciGMIWC_picnum').html((index+1)+'/'+gmapsMarkup.currentInfo.nbImgTxt);
    328     $('#ciWALeft, #ciWARight').css('display', 'inline-block');
    329   }
    330   else
    331   {
    332     $('#ciGMIWC_picnum').html(gmapsMarkup.currentInfo.nbImgTxt);
    333     $('#ciWALeft, #ciWARight').css('display', 'none');
    334   }
    335 }
    336 
    337 /**
    338  *
    339  */
    340 function displayPicturePrev()
    341 {
    342   gmapsMarkup.currentInfo.displayed--;
    343   if(gmapsMarkup.currentInfo.displayed<0) gmapsMarkup.currentInfo.displayed=gmapsMarkup.currentInfo.nbImg-1;
    344   displayPictureInfo(gmapsMarkup.currentInfo.displayed);
    345 }
    346 
    347 /**
    348  *
    349  */
    350 function displayPictureNext()
    351 {
    352   gmapsMarkup.currentInfo.displayed++;
    353   if(gmapsMarkup.currentInfo.displayed>=gmapsMarkup.currentInfo.nbImg) gmapsMarkup.currentInfo.displayed=0;
    354   displayPictureInfo(gmapsMarkup.currentInfo.displayed);
    355 }
    356 
    357 
    358 /**
    359  * check if zoomLevel
    360  */
    361 function fitToBounds(bounds, mapIndex)
    362 {
    363   gmapsMarkup.maps[mapIndex].gMap.fitBounds(bounds);
    364 
    365   if(gmapsMarkup.maps[mapIndex].zoomLevelMaxActivated &&
    366      gmapsMarkup.maps[mapIndex].gMap.getZoom() > gmapsMarkup.maps[mapIndex].zoomLevel)
    367   {
    368     gmapsMarkup.maps[mapIndex].gMap.setZoom(gmapsMarkup.maps[mapIndex].zoomLevel);
    369   }
    370 }
    371 
    372 function initializeMapViewport(mapIndex)
    373 {
    374   if(mapIndex>-1 && !gmapsMarkup.maps[mapIndex].gMap.initialized)
    375   {
    376     // reduce copyright size... ^_^
    377     $('#'+gmapsMarkup.maps[mapIndex].id+' span, #'+gmapsMarkup.maps[mapIndex].id+' a').css('font-size', '55.0%');
    378 
    379     if(gmapsMarkup.maps[mapIndex].markerVisible)
    380     {
    381       google.maps.event.addListener(
    382         gmapsMarkup.maps[mapIndex].gMap,
    383         'dragend',
    384         function()
    385         {
    386           loadMarkers(this);
    387         }
    388       );
    389 
    390       google.maps.event.addListener(
    391         gmapsMarkup.maps[mapIndex].gMap,
    392         'zoom_changed',
    393         function()
    394         {
    395           loadMarkers(this);
    396           gmapsMarkup.infoWindow.close();
    397         }
    398       );
    399     }
    400 
    401 
    402     if(gmapsMarkup.maps[mapIndex].kmlZoom && gmapsMarkup.maps[mapIndex].gMap.kmlFile!=null)
    403     {
    404       google.maps.event.addListenerOnce(
    405         gmapsMarkup.maps[mapIndex].gMap.kmlFile,
    406         'defaultviewport_changed',
    407         function()
    408         {
    409           fitToBounds(gmapsMarkup.maps[mapIndex].gMap.kmlFile.getDefaultViewport(), mapIndex);
    410         }
    411       );
    412 
    413     }
    414 
    415     gmapsMarkup.maps[mapIndex].gMap.initialized=true;
    416   }
    417 }
    418 
    419423
    420424$(window).load(function ()
    421425  {
     426    var mm=new markupMaps();
     427
    422428    // all maps have the same initials bounds
    423429    gmapsMarkup.currentInfo=null;
     
    428434     'closeclick',
    429435     function () {
    430        $('body').append($('#iGMapsInfoWindowContent'));
     436       //$('body').append($('#iGMapsInfoWindowContent'));
    431437       gmapsMarkup.infoWindow.setContent('');
    432438       $('#ciGMIWC_img').unbind();
     
    459465              );
    460466
    461               createMap(gmapsMarkup.maps[i], i);
     467              mm.createMap(gmapsMarkup.maps[i], i);
    462468            }
    463469          }
     
    466472
    467473
    468 
    469     $('body').append($('<div/>',
     474    if($('#iGMapsInfoWindow').length==0)
     475    {
     476      $('body').append($('<div/>',
    470477                        {
    471478                          id:'iGMapsInfoWindow',
     
    491498                                                                        css:{width:'28px'}
    492499                                                                      }
    493                                                                      ).append($('<div id="iWALeft" onclick="displayPicturePrev();"/>')
     500                                                                     ).append($('<div id="iWALeft" onclick="mm.displayPicturePrev();"/>')
    494501                                                                             )
    495502                                                                   )
     
    506513                                                                        css:{width:'28px'}
    507514                                                                      }
    508                                                                     ).append($('<div id="iWARight" onclick="displayPictureNext();">')
     515                                                                    ).append($('<div id="iWARight" onclick="mm.displayPictureNext();">')
    509516                                                                            )
    510517                                                                  )
     
    538545                              )
    539546                    );
     547    }
    540548
    541549  }
  • extensions/GMaps/js/gmapsMarkup.packed.js

    r7500 r7616  
    1 /* file: gmapsMarkup.js - v1.0.0 | packed on 2010/10/30 with http://joliclic.free.fr/php/javascript-packer/ */
    2 eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('t T=[r,{w:32,h:32,x:15,y:31},{w:32,h:32,x:15,y:31},{w:32,h:32,x:10,y:31},{w:30,h:2K,x:4,y:39},];9 2u(8,R){t z=o l.5.2J(o l.5.1v(8.17.1S,8.17.1G),o l.5.1v(8.17.1T,8.17.1D)),3=o l.5.2L($("#"+8.k).26(0),{2M:\'#2N\',2I:8.2H,2C:8.1s,2B:z.2g(),1c:(8.1c==-1)?E:u,2D:(8.1c==-1)?E:u,2q:(8.2q==\'n\')?E:u,2w:(8.2w==\'n\')?E:u,1n:(8.1n==-1)?E:u,2E:{2G:8.1n},2F:\'\',});6(8.2p!=\'\'){C=o l.5.2O(8.2p,{2P:u});C.1X(3)}A{C=r}2v=/^2Y(\\d\\d)2X.*/i;v=2v.2A(8.S);6(v!=r)v=o 33(v[1]);6(v!=r){3.S=o l.5.34(\'1q/1r/1C/\'+8.S,o l.5.2W(T[v].w,T[v].h),o l.5.2l(0,0),o l.5.2l(T[v].x,T[v].y))}A{3.S=r}3.z=z;3.C=C;3.f=o 2V();3.R=R;3.I=8.I;3.N=8.N;3.O=0;3.1x=8.1x;3.1m=E;8.q=3;6(8.2R){6(8.11){11(3.z,R)}A{3.2Q(3.z.2g())}}6(8.2m){13(3)}A{1t(R)}}9 13(3){6(3.V()==r)L(E);3.O++;1y={1e:2.1e,O:3.O,z:{1T:3.V().1R().1u(),1D:3.V().1R().1w(),1S:3.V().1P().1u(),1G:3.V().1P().1w()},I:3.I,N:3.N,2S:20,19:3.R,};$.1Z({21:"27",28:"1q/1r/2e.2f",2d:u,29:{2a:"2b.5.2T",1y:1y},25:9(16){Q=$.2U(16);6(3.O==Q.O){Q.f.35(2r);2c(2.5[Q.19].q,Q.f);1t(Q.19)}}})}9 2c(3,f){6(3==r)L(E);6(3.f.D>0){t i=0;2z(i<3.f.D){1a=2i(3.f[i].H,f);6(1a==-1){3.f[i].g.1X(r);3.f.2o(i,1)}A{f.2o(1a,1);i++}}}W(t i=0;i<f.D;i++){t g=o l.5.2y({2Z:o l.5.1v(f[i].1u,f[i].1w),3:3,2j:f[i].1f});6(3.S!=r)g.3i(3.S);g.B=f[i];g.B.p=0;3.f.3Q({g:g,H:f[i].H});6(3.1x){l.5.X.14(g,\'1I\',9(){1L(1j)})}W(t j=0;j<g.B.J.D;j++){3C(g.B.J[j].3L(0)){22\'G\':g.B.J[j]=\'./3F/\'+g.B.J[j].24(1);2t;22\'U\':g.B.J[j]=\'./3J/\'+g.B.J[j].24(1);2t}}}}9 2r(1h,1k){6(1h.H<1k.H){L(-1)}A 6(1h.H<1k.H){L(1)}L(0)}9 2i(2n,1o){W(t i=0;i<1o.D;i++){6(1o[i].H==2n)L(i)}L(-1)}9 1L(g){2.7=g.B;2.M.2k();2.M.23($(\'#1i\').3I().1N(1p).26(0));2.M.3K(g.3,g);12(2.7.p)}9 1p(i,e){6(e.k!=\'\')e.k=\'c\'+e.k;$(e).3M().1N(1p)}9 12(j){2.7.p=j;6(2.7.1H[j]==\'\'){$(\'#1K\').F(\'&3H;\')}A{$(\'#1K\').F(2.7.1H[j])}$(\'#Y\').3B(\'1B\',2.7.J[j]);$(\'#Y\').1Y();6(2.7.Z[j].D==1){$(\'#Y\').1d(\'1I\',9(){2x.3D=2.7.Z[2.7.p][0]})}A{$(\'#1O\').F(\'\');W(t i=0;i<2.7.Z[j].D;i++){$(\'#1O\').m(\'<1V><a 3E="\'+2.7.Z[j][i]+\'">\'+2.7.3O[j][i]+\'</a></1V>\')}$(\'#Y, #1l\').1d(\'36\',9(){$(\'#1l\').s(\'P\',\'1W\')}).1d(\'3U\',9(){$(\'#1l\').s(\'P\',\'18\')})}6(2.7.1b>1){$(\'#1z\').F((j+1)+\'/\'+2.7.1f);$(\'#1A, #1E\').s(\'P\',\'3V-1W\')}A{$(\'#1z\').F(2.7.1f);$(\'#1A, #1E\').s(\'P\',\'18\')}}9 1F(){2.7.p--;6(2.7.p<0)2.7.p=2.7.1b-1;12(2.7.p)}9 1J(){2.7.p++;6(2.7.p>=2.7.1b)2.7.p=0;12(2.7.p)}9 11(z,b){2.5[b].q.3S(z);6(2.5[b].3P&&2.5[b].q.3T()>2.5[b].1s){2.5[b].q.3R(2.5[b].1s)}}9 1t(b){6(b>-1&&!2.5[b].q.1m){$(\'#\'+2.5[b].k+\' 1M, #\'+2.5[b].k+\' a\').s(\'3G-3z\',\'3h.0%\');6(2.5[b].2m){l.5.X.14(2.5[b].q,\'3g\',9(){13(1j)});l.5.X.14(2.5[b].q,\'3A\',9(){13(1j);2.M.2k()})}6(2.5[b].3j&&2.5[b].q.C!=r){l.5.X.3k(2.5[b].q.C,\'3f\',9(){11(2.5[b].q.C.3e(),b)})}2.5[b].q.1m=u}}$(2x).38(9(){2.7=r;2.M=o l.5.37();l.5.X.14(2.M,\'3a\',9(){$(\'2s\').m($(\'#1i\'));2.M.23(\'\');$(\'#Y\').1Y()});$.1Z({21:"27",28:"1q/1r/2e.2f",2d:u,29:{2a:"2b.5.3b",3d:2.3c,3l:\'y\'},25:9(16){2.1e=16;W(t i=0;i<2.5.D;i++){$(\'#\'+2.5[i].k).s({I:2.5[i].I+\'2h\',N:2.5[i].N+\'2h\'});2u(2.5[i],i)}}});$(\'2s\').m($(\'<K/>\',{k:\'3m\',s:{P:\'18\'},}).m($(\'<K/>\',{k:\'1i\'}).m($(\'<K/>\',{k:\'3v\',F:\'(2j)\'})).m($(\'<3u/>\',{k:\'3w\'}).m($(\'<3x/>\').m($(\'<1g/>\',{s:{I:\'1Q\'}}).m($(\'<K k="3y" 1U="1F();"/>\'))).m($(\'<1g/>\').m($(\'<1C/>\',{k:\'3t\',1B:\'\'}))).m($(\'<1g/>\',{s:{I:\'1Q\'}}).m($(\'<K k="3s" 1U="1J();">\'))))).m($(\'<K/>\',{k:\'3o\',F:\'0/0 3n\'})).m($(\'<K/>\',{k:\'3p\',s:{P:\'18\'}}).m($(\'<1M/>\',{F:\'3q\'})).m($(\'<3r/>\',{k:\'3N\'})))))});',62,244,'||gmapsMarkup|map||maps|if|currentInfo|properties|function||mapIndex||||markers|marker|||index|id|google|append||new|displayed|gMap|null|css|var|true|iM||||bounds|else|info|kmlFile|length|false|html||uId|width|imgTn|div|return|infoWindow|height|callId|display|tmp|gmapsIndex|markerImg|markerImgProp||getBounds|for|event|ciGMIWC_img|imgCatsUrl||fitToBounds|displayPictureInfo|loadMarkers|addListener||msg|mapBounds|none|loadIndex|newListIndex|nbImg|navigationControl|bind|requestId|nbImgTxt|td|m1|iGMapsInfoWindowContent|this|m2|ciGMIWC_showcat|initialized|mapTypeControl|markerList|renameId|plugins|GMaps|zoomLevel|initializeMapViewport|lat|LatLng|lng|allowBubble|datas|ciGMIWC_picnum|ciWALeft|src|img|east|ciWARight|displayPicturePrev|west|imgName|click|displayPictureNext|ciGMIWC_title|displayWindowInfo|span|each|ciGMIWC_showcatList|getSouthWest|28px|getNorthEast|south|north|onclick|li|block|setMap|unbind|ajax||type|case|setContent|substr|success|get|POST|url|data|ajaxfct|public|applyMarkers|async|gmaps_ajax|php|getCenter|px|markerInList|title|close|Point|markerVisible|uniqueId|splice|kmlFileUrl|scaleControl|compareMarkers|body|break|createMap|re|streetViewControl|window|Marker|while|exec|center|zoom|scrollwheel|mapTypeControlOptions|markerTitle|style|mapType|mapTypeId|LatLngBounds|40|Map|backgroundColor|ffffff|KmlLayer|preserveViewport|setCenter|geolocated|distanceTreshold|getMarkers|parseJSON|Array|Size|_|mS|position||||Number|MarkerImage|sort|mouseenter|InfoWindow|load||closeclick|init|categoryId|category|getDefaultViewport|defaultviewport_changed|dragend|55|setIcon|kmlZoom|addListenerOnce|mapId|iGMapsInfoWindow|photo|iGMIWC_picnum|iGMIWC_showcat|gmaps_i_show_this_picture_in|ul|iWARight|iGMIWC_img|table|iGMIWC_title|iGMIWC_thumb|tr|iWALeft|size|zoom_changed|attr|switch|location|href|galleries|font|nbsp|clone|upload|open|charAt|children|iGMIWC_showcatList|imgCatsNames|zoomLevelMaxActivated|push|setZoom|fitBounds|getZoom|mouseleave|inline'.split('|'),0,{}))
     1/* file: gmapsMarkup.js - v1.1.0 | packed on 2010/11/04 with http://joliclic.free.fr/php/javascript-packer/ */
     2eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('f V=[s,{w:32,h:32,x:15,y:31},{w:32,h:32,x:15,y:31},{w:32,h:32,x:10,y:31},{w:30,h:2M,x:4,y:39},];9 2m(){P.1Q=9(8,S){f z=p l.3.2O(p l.3.1i(8.11.25,8.11.2b),p l.3.1i(8.11.1W,8.11.1X)),5=p l.3.2B($("#"+8.m).1P(0),{2D:\'#2J\',3h:8.3c,3d:8.1n,3f:z.1V(),1g:(8.1g==-1)?E:v,2V:(8.1g==-1)?E:v,21:(8.21==\'n\')?E:v,22:(8.22==\'n\')?E:v,1k:(8.1k==-1)?E:v,3b:{33:8.1k},2Z:\'\',});6(8.1Z!=\'\'){F=p l.3.2Y(8.1Z,{2X:v});F.1T(5)}A{F=s}1Y=/^37(\\d\\d)3e.*/i;C=1Y.3g(8.T);6(C!=s)C=p 38(C[1]);6(C!=s){5.T=p l.3.3a(\'1w/1v/1O/\'+8.T,p l.3.2U(V[C].w,V[C].h),p l.3.1U(0,0),p l.3.1U(V[C].x,V[C].y))}A{5.T=s}5.z=z;5.F=F;5.k=p 2G();5.S=S;5.I=8.I;5.O=8.O;5.Q=0;5.1j=8.1j;5.1e=E;8.q=5;6(8.2H){6(8.12){12(5.z,S)}A{5.2E(5.z.1V())}}6(8.2q){17(5)}A{1m(S)}};f 17=9(5){6(5.Y()==s)N(E);5.Q++;1s={1x:2.1x,Q:5.Q,z:{1W:5.Y().24().1t(),1X:5.Y().24().1h(),25:5.Y().2c().1t(),2b:5.Y().2c().1h()},I:5.I,O:5.O,2R:20,1b:5.S,};$.2t({2u:"2s",2r:"1w/1v/2n.2i",2w:v,2g:{2j:"2k.3.2P",1s:1s},1J:9(1a){M=$.2L(1a);6(2.3[M.1b].q.Q==M.Q){M.k.3i(1G);26(2.3[M.1b].q,M.k);1m(M.1b)}}})};f 26=9(5,k){6(5==s)N(E);6(5.k.u>0){f i=0;3P(i<5.k.u){1l=1A(5.k[i].D,k);6(1l==-1){5.k[i].j.1T(s);5.k.2e(i,1)}A{k.2e(1l,1);i++}}}W(f i=0;i<k.u;i++){f j=p l.3.3H({3I:p l.3.1i(k[i].1t,k[i].1h),5:5,1D:k[i].1q});6(5.T!=s)j.3J(5.T);j.B=k[i];j.B.r=0;5.k.3R({j:j,D:k[i].D});6(5.1j){l.3.Z.13(j,\'1K\',9(){1H(P)})}W(f g=0;g<j.B.J.u;g++){3T(j.B.J[g].3V(0)){2f\'G\':j.B.J[g]=\'./3W/\'+j.B.J[g].1C(1);1F;2f\'U\':j.B.J[g]=\'./3p/\'+j.B.J[g].1C(1);1F}}}};f 1G=9(1f,1c){6(1f.D<1c.D){N(-1)}A 6(1f.D<1c.D){N(1)}N(0)};f 1A=9(1S,1d){W(f i=0;i<1d.u;i++){6(1d[i].D==1S)N(i)}N(-1)};f 1H=9(j){2.7=j.B;2.K.2p();2.K.2x($(\'#1B\').3k().1N(1o).1P(0));2.K.3l(j.5,j);16(2.7.r)};f 1o=9(i,e){6(e.m!=\'\')e.m=\'c\'+e.m;$(e).3m().1N(1o)};f 16=9(g){2.7.r=g;6(2.7.1I[g]==\'\'){$(\'#1M\').H(\'&3u;\')}A{$(\'#1M\').H(2.7.1I[g])}$(\'#X\').3C(\'27\',2.7.J[g]);$(\'#X\').2o();6(2.7.18[g].u==1){$(\'#X\').1u(\'1K\',9(){2h.3A=2.7.18[2.7.r][0]})}A{$(\'#1L\').H(\'\');W(f i=0;i<2.7.18[g].u;i++){$(\'#1L\').o(\'<28><a 3v="\'+2.7.18[g][i]+\'">\'+2.7.3w[g][i]+\'</a></28>\')}$(\'#X, #1p\').1u(\'3y\',9(){$(\'#1p\').t(\'R\',\'2z\')}).1u(\'3x\',9(){$(\'#1p\').t(\'R\',\'14\')})}6(2.7.1r>1){$(\'#2y\').H((g+1)+\'/\'+2.7.1q);$(\'#2v, #2l\').t(\'R\',\'3D-2z\')}A{$(\'#2y\').H(2.7.1q);$(\'#2v, #2l\').t(\'R\',\'14\')}};P.1z=9(){2.7.r--;6(2.7.r<0)2.7.r=2.7.1r-1;16(2.7.r)};P.2d=9(){2.7.r++;6(2.7.r>=2.7.1r)2.7.r=0;16(2.7.r)};f 12=9(z,b){2.3[b].q.3n(z);6(2.3[b].3o&&2.3[b].q.3r()>2.3[b].1n){2.3[b].q.3q(2.3[b].1n)}};f 1m=9(b){6(b>-1&&!2.3[b].q.1e){$(\'#\'+2.3[b].m+\' 23, #\'+2.3[b].m+\' a\').t(\'3M-3Q\',\'3O.0%\');6(2.3[b].2q){l.3.Z.13(2.3[b].q,\'3N\',9(){17(P)});l.3.Z.13(2.3[b].q,\'3s\',9(){17(P);2.K.2p()})}6(2.3[b].2S&&2.3[b].q.F!=s){l.3.Z.2K(2.3[b].q.F,\'2I\',9(){12(2.3[b].q.F.2A(),b)})}2.3[b].q.1e=v}}}$(2h).2W(9(){f 19=p 2m();2.7=s;2.K=p l.3.3F();l.3.Z.13(2.K,\'34\',9(){2.K.2x(\'\');$(\'#X\').2o()});$.2t({2u:"2s",2r:"1w/1v/2n.2i",2w:v,2g:{2j:"2k.3.3t",3B:2.3E,3z:\'y\'},1J:9(1a){2.1x=1a;W(f i=0;i<2.3.u;i++){$(\'#\'+2.3[i].m).t({I:2.3[i].I+\'1R\',O:2.3[i].O+\'1R\'});19.1Q(2.3[i],i)}}});6($(\'#1E\').u==0){$(\'3j\').o($(\'<L/>\',{m:\'1E\',t:{R:\'14\'},}).o($(\'<L/>\',{m:\'1B\'}).o($(\'<L/>\',{m:\'3G\',H:\'(1D)\'})).o($(\'<3U/>\',{m:\'3X\'}).o($(\'<3K/>\').o($(\'<1y/>\',{t:{I:\'29\'}}).o($(\'<L m="3S" 2a="19.1z();"/>\'))).o($(\'<1y/>\').o($(\'<1O/>\',{m:\'3L\',27:\'\'}))).o($(\'<1y/>\',{t:{I:\'29\'}}).o($(\'<L m="2N" 2a="19.2d();">\'))))).o($(\'<L/>\',{m:\'2T\',H:\'0/0 2F\'})).o($(\'<L/>\',{m:\'2Q\',t:{R:\'14\'}}).o($(\'<23/>\',{H:\'35\'})).o($(\'<2C/>\',{m:\'36\'})))))}});',62,246,'||gmapsMarkup|maps||map|if|currentInfo|properties|function||mapIndex||||var|index|||marker|markers|google|id||append|new|gMap|displayed|null|css|length|true||||bounds|else|info|iM|uId|false|kmlFile||html|width|imgTn|infoWindow|div|tmp|return|height|this|callId|display|gmapsIndex|markerImg||markerImgProp|for|ciGMIWC_img|getBounds|event||mapBounds|fitToBounds|addListener|none||displayPictureInfo|loadMarkers|imgCatsUrl|mm|msg|loadIndex|m2|markerList|initialized|m1|navigationControl|lng|LatLng|allowBubble|mapTypeControl|newListIndex|initializeMapViewport|zoomLevel|renameId|ciGMIWC_showcat|nbImgTxt|nbImg|datas|lat|bind|GMaps|plugins|requestId|td|displayPicturePrev|markerInList|iGMapsInfoWindowContent|substr|title|iGMapsInfoWindow|break|compareMarkers|displayWindowInfo|imgName|success|click|ciGMIWC_showcatList|ciGMIWC_title|each|img|get|createMap|px|uniqueId|setMap|Point|getCenter|north|east|re|kmlFileUrl||scaleControl|streetViewControl|span|getNorthEast|south|applyMarkers|src|li|28px|onclick|west|getSouthWest|displayPictureNext|splice|case|data|window|php|ajaxfct|public|ciWARight|markupMaps|gmaps_ajax|unbind|close|markerVisible|url|POST|ajax|type|ciWALeft|async|setContent|ciGMIWC_picnum|block|getDefaultViewport|Map|ul|backgroundColor|setCenter|photo|Array|geolocated|defaultviewport_changed|ffffff|addListenerOnce|parseJSON|40|iWARight|LatLngBounds|getMarkers|iGMIWC_showcat|distanceTreshold|kmlZoom|iGMIWC_picnum|Size|scrollwheel|load|preserveViewport|KmlLayer|markerTitle||||style|closeclick|gmaps_i_show_this_picture_in|iGMIWC_showcatList|mS|Number||MarkerImage|mapTypeControlOptions|mapType|zoom|_|center|exec|mapTypeId|sort|body|clone|open|children|fitBounds|zoomLevelMaxActivated|upload|setZoom|getZoom|zoom_changed|init|nbsp|href|imgCatsNames|mouseleave|mouseenter|mapId|location|category|attr|inline|categoryId|InfoWindow|iGMIWC_title|Marker|position|setIcon|tr|iGMIWC_img|font|dragend|55|while|size|push|iWALeft|switch|table|charAt|galleries|iGMIWC_thumb'.split('|'),0,{}))
  • extensions/GMaps/main.inc.php

    r7576 r7616  
    22/*
    33Plugin Name: GMaps
    4 Version: 1.2.2
     4Version: 1.2.3
    55Description: Display and manage (google) maps
    66Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=454
     
    7878|         |            |   . Incompatibility with PHP prior than 5.2.2
    7979|         |            |
     80| 1.2.3   | 2010-11-04 | * mantis bug:2004
     81|         |            |   . Cache table becomes very huge
    8082|         |            |
    81 |         |            |
     83|         |            | * mantis bug:2005
     84|         |            |   . Category map is not displayed when a [gmaps] map is
     85|         |            |     inserted in category description
    8286|         |            |
    8387|         |            |
  • extensions/GMaps/maintain.inc.php

    r7398 r7616  
    3535  if(CommonPlugin::checkGPCRelease(GMAPS_GPC_NEEDED))
    3636  {
    37     @include_once('gmaps_install.class.inc.php');
     37    include_once('gmaps_install.class.inc.php');
    3838    $gpcInstalled=true;
    3939  }
Note: See TracChangeset for help on using the changeset viewer.