source: extensions/GMaps/gmaps_pip.class.inc.php @ 15907

Last change on this file since 15907 was 15345, checked in by grum, 12 years ago

feature:2638 - Compatibility with Piwigo 2.4

  • Property svn:executable set to *
File size: 22.1 KB
Line 
1<?php
2/* -----------------------------------------------------------------------------
3  Plugin     : GMaps
4  Author     : Grum
5    email    : grum@piwigo.org
6    website  : http://photos.grum.fr
7
8    << May the Little SpaceFrog be with you ! >>
9  ------------------------------------------------------------------------------
10  See main.inc.php for release information
11
12  GMaps_PIP : classe to manage plugin public pages
13
14  --------------------------------------------------------------------------- */
15
16include_once('gmaps_root.class.inc.php');
17
18class GMaps_PIP extends GMaps_root
19{
20  const CAT_ID_HOME = 0;
21  const CAT_ID_TAGS = -1;
22
23  protected $category=array(
24    'id' => 0,
25    'bounds' => array(
26      'N' => -90,
27      'S' => 90,
28      'E' => -180,
29      'W' => 180
30    ),
31    'icon' => array(
32      'style' => true,
33      'file' => '',
34      'width' => -1,
35      'height' => -1
36    )
37  );
38  protected $picture=array(
39    'geolocated' => false,
40    'forceDisplay' => false,
41    'coords' => array('lat' => 0, 'lng' => 0),
42    'content' => array(
43      'I' => array(), // icon display mode
44      'M' => array(), // meta display mode
45    ),
46    'properties' => array(),
47    'icon' => array(
48      'style' => true,
49      'file' => '',
50      'width' => -1,
51      'height' => -1
52      )
53  );
54  protected $css2;
55
56  public function __construct($prefixeTable, $filelocation)
57  {
58    parent::__construct($prefixeTable, $filelocation);
59    $this->css2 = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles()."2.css");
60    $this->loadConfig();
61    $this->initEvents();
62    $this->load_lang();
63  }
64
65  public function __destruct()
66  {
67    unset($maps);
68    unset($picture);
69    parent::__destruct();
70  }
71
72  /*
73    load language file
74  */
75  public function load_lang()
76  {
77    global $lang;
78
79    load_language('plugin.lang', GMAPS_PATH);
80  }
81
82  /*
83    initialize events call for the plugin
84  */
85  public function initEvents()
86  {
87    parent::initEvents();
88
89    add_event_handler('loc_begin_index', array(&$this, 'displayCategoryPageMap'));
90    if(!isset($_GET['slideshow'])) add_event_handler('loc_begin_picture', array(&$this, 'displayPicturePageMap'), EVENT_HANDLER_PRIORITY_NEUTRAL+5);
91    add_event_handler('amd_jpegMD_loaded', array(&$this, 'preparePictureMaps'));
92    add_event_handler('loc_end_page_header', array(&$this->css2, 'applyCSS'));
93    add_event_handler('render_category_description',  array(&$this, 'categoryMarkup'), EVENT_HANDLER_PRIORITY_NEUTRAL-5, 2);
94  }
95
96
97
98  /* -------------------------------------------------------------------------
99    FUNCTIONS TO MANAGE GMAPS
100  ------------------------------------------------------------------------- */
101
102
103  /**
104   * this function display maps defined as markup in the categories description
105   * [gmaps=id:999;with:999;height:999;kmlId:999;kmlUrl:"xxx";kmlZoom:y|n;markerImg:xxx;markerVisible:y|n;allowBubble:y|n;]
106   *
107   * the function is called on the 'render_category_description' event
108   * maps are displayed only for 'main_page_category_description' page
109   *
110   * @param String $desc : category description
111   * @param String $param : category page (expected value: 'main_page_category_description')
112   * @return String : the modified description
113   */
114  public function categoryMarkup($desc, $param='')
115  {
116    global $template, $page;
117
118    $mapParams=array();
119    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)
120    {
121      if($param!='main_page_category_description')
122      {
123        // if not main page, just remove the [gmaps] markup
124        $desc = preg_replace('/\[gmaps=(?:.*)\]/i','',$desc);
125        return($desc);
126      }
127
128
129      GPCCore::addHeaderJS("jquery", "themes/default/js/jquery.js");
130      GPCCore::addHeaderJS("jquery.ui", "themes/default/js/ui/jquery.ui.core.js", array('jquery'));
131      GPCCore::addHeaderJS("jquery.ui.widget", "themes/default/js/ui/jquery.ui.widget.js", array('jquery.ui'));
132
133      GPCCore::addHeaderJS("maps.google.com/api", "http://maps.google.com/maps/api/js?sensor=false");
134      GPCCore::addHeaderJS('gmaps.infoWindow', GMAPS_PATH.'js/gmapsInfoWindow.js', array('jquery'));
135      GPCCore::addHeaderJS("gmaps.markup", "plugins/GMaps/js/gmapsMarkup.js", array('jquery'));
136
137      $desc = preg_replace(
138        '/\[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',
139        "<div class='gmapsMarkup' id='gmapsMarkupId$1'></div>", $desc);
140
141      $scripts=array();
142
143      foreach($mapParams as $mapParam)
144      {
145        $nb=$this->prepareCategoryMap($page['category']['id'], $mapParam['id']);
146
147        if(!isset($mapParam['allowBubble'])) $mapParam['allowBubble']='y';
148        if(!isset($mapParam['kmlZoom'])) $mapParam['kmlZoom']='n';
149        if(!isset($mapParam['width'])) $mapParam['width']='';
150        if(!isset($mapParam['height'])) $mapParam['height']='';
151        if(!isset($mapParam['markerImg']) or $mapParam['markerImg']=='') $mapParam['markerImg']='mS01_11.png';
152        if(!isset($mapParam['markerVisible']) or $mapParam['markerVisible']=='') $mapParam['markerVisible']='y';
153        if(isset($mapParam['kmlId']) and $mapParam['kmlId']!='')
154        {
155          $sql="SELECT file
156                FROM ".$this->tables['kmlfiles']."
157                WHERE id=".$mapParam['kmlId'];
158          $result=pwg_query($sql);
159          if($result)
160          {
161            while($row=pwg_db_fetch_assoc($result))
162            {
163              $mapParam['kmlUrl']=get_absolute_root_url().PWG_LOCAL_DIR.self::KML_DIRECTORY.$row['file'];
164            }
165          }
166        }
167        if(!isset($mapParam['kmlUrl'])) $mapParam['kmlUrl']='';
168
169        foreach($this->maps as $map)
170        {
171          $scripts[]="
172            {
173              id:'gmapsMarkupId".$mapParam['id']."',
174              mapId:".$mapParam['id'].",
175              zoomLevel:".$map['zoomLevel'].",
176              markerImg:'".$mapParam['markerImg']."',
177              markerVisible:".($mapParam['markerVisible']=='y'?'true':'false').",
178              mapType:'".$map['mapType']."',
179              mapTypeControl:'".$map['mapTypeControl']."',
180              navigationControl:'".$map['navigationControl']."',
181              scaleControl:'".$map['scaleControl']."',
182              streetViewControl:'".$map['streetViewControl']."',
183              kmlFileUrl:'".$mapParam['kmlUrl']."',
184              displayType:'".$map['displayType']."',
185              width:".($mapParam['width']==''?$map['width']:$mapParam['width']).",
186              height:".($mapParam['height']==''?$map['height']:$mapParam['height']).",
187              markers:[],
188              fitToBounds:true,
189              zoomLevelMaxActivated:".($map['zoomLevelMaxActivated']=='y'?'true':'false').",
190              mapBounds:
191                {
192                  north:".$this->category['bounds']['N'].",
193                  south:".$this->category['bounds']['S'].",
194                  east:".$this->category['bounds']['E'].",
195                  west:".$this->category['bounds']['W']."
196                },
197              geolocated:".($nb>0?'true':'false').",
198              kmlZoom:".($mapParam['kmlZoom']=='y'?'true':'false').",
199              allowBubble:".($mapParam['allowBubble']=='y'?'true':'false')."
200            }
201          ";
202        }
203      }
204
205      $template->append('head_elements',
206        "<script type=\"text/javascript\">
207        var gmapsMarkup =
208              {
209                categoryId:".$page['category']['id'].",
210                maps:
211                [".implode(',', $scripts)."]
212              },
213            gmaps =
214              {
215                lang:{
216                  boundmap:'".l10n('gmaps_i_boundmap')."',
217                  boundkml:'".l10n('gmaps_i_boundkml')."',
218                  loading:'".l10n('gmaps_loading')."',
219                  gmaps_i_show_this_picture_in:'".l10n('gmaps_i_show_this_picture_in')."'
220                }
221              };
222        </script>", false);
223    }
224    return($desc);
225  }
226
227
228
229  /**
230   * this function display the map on the category page
231   */
232  public function displayCategoryPageMap()
233  {
234    global $page, $prefixeTable, $template, $user, $conf;
235
236    if($page['section']=='categories' or $page['section']=='tags')
237    {
238      if(isset($page['category']))
239      {
240        $nb=$this->prepareCategoryMap($page['category']['id'], null);
241      }
242      else
243      {
244        $nb=$this->prepareCategoryMap(0, null);
245      }
246
247      if(count($this->maps)>0)
248      {
249        $scripts=array();
250
251        if($nb>0 or $this->forceDisplay>0)
252        {
253          /*
254           * prepare js script for each map
255           */
256
257          foreach($this->maps as $keyMap => $map)
258          {
259            if($nb>0 or
260               $map['forceDisplay']=='y' and ($map['kmlFileUrl']!='' or $map['kmlFileId']!=0)
261              )
262            {
263              $scripts[]="
264              {
265                id:'iGMapsIcon',
266                zoomLevel:".$map['zoomLevel'].",
267                markerImg:'".$map['marker']."',
268                mapType:'".$map['mapType']."',
269                mapTypeControl:'".$map['mapTypeControl']."',
270                navigationControl:'".$map['navigationControl']."',
271                scaleControl:'".$map['scaleControl']."',
272                streetViewControl:'".$map['streetViewControl']."',
273                kmlFileUrl:'".$map['kmlFileUrl']."',
274                displayType:'".$map['displayType']."',
275                sizeMode:'".$map['sizeMode']."',
276                title:'".addslashes( ($map['title']=='')?l10n('gmaps_geolocation'):$map['title']  )."',
277                markers:[],
278                fitToBounds:true,
279                zoomLevelMaxActivated:".($map['zoomLevelMaxActivated']=='y'?'true':'false')."
280              }";
281
282              preg_match('/^i(\d+)x(\d+).*/i', basename($map['icon']), $result);
283              $this->category['icon']['iconStyle']=$map['iconStyle'];
284              $this->category['icon']['file']=$map['icon'];
285              $this->category['icon']['width']=isset($result[1])?$result[1]:-1;
286              $this->category['icon']['height']=isset($result[2])?$result[2]:-1;
287            }
288          }
289
290          $template->assign('maps', $this->maps);
291          $template->set_filename('gmapsCatMap',
292                      dirname($this->getFileLocation()).'/templates/gmaps_category.tpl');
293          $template->append('footer_elements', $template->parse('gmapsCatMap', true), false);
294
295          if(is_array($this->category['icon']))
296          {
297            $template->assign('mapIcon', $this->category['icon']);
298            $template->set_filename('gmapsIconButton',
299                        dirname($this->getFileLocation()).'/templates/gmaps_category_iconbutton.tpl');
300            $template->concat('PLUGIN_INDEX_ACTIONS', $template->parse('gmapsIconButton', true), false);
301            $template->assign('mapIcon');
302          }
303
304          $template->append('head_elements',
305"<script type=\"text/javascript\">
306var gmaps =
307  {
308    geolocated:".($nb>0?'true':'false').",
309    forceDisplay:".($nb==0?'true':'false').",
310    lang:{
311      boundmap:'".l10n('gmaps_i_boundmap')."',
312      boundkml:'".l10n('gmaps_i_boundkml')."',
313      loading:'".l10n('gmaps_loading')."',
314      gmaps_i_show_this_picture_in:'".l10n('gmaps_i_show_this_picture_in')."'
315    },
316    requestId:'',
317    categoryId:".$this->category['id'].",
318    bounds:
319      {
320        north:".$this->category['bounds']['N'].",
321        south:".$this->category['bounds']['S'].",
322        east:".$this->category['bounds']['E'].",
323        west:".$this->category['bounds']['W']."
324      },
325    maps:
326    [".implode(',', $scripts)."],
327    popupAutomaticSize:".$this->config['popupAutomaticSize']."
328  };
329</script>", false);
330
331          GPCCore::addHeaderJS('gmaps.infoWindow', GMAPS_PATH.'js/gmapsInfoWindow.js', array('jquery'));
332          GPCCore::addHeaderJS('gmaps.category', GMAPS_PATH.'js/gmapsCategory.js', array('jquery', 'gmaps.infoWindow'));
333        }
334      }
335    }
336  }
337
338
339  /**
340   * this function prepare data ($this->category var) for a category map
341   *  $this->maps must be initialized
342   *
343   * if a map id is given, datas are prepared for the given map otherwise maps
344   * are automatically searched from the current category
345   *
346   * @param Integer $catId : category id
347   * @param Integer $mapId : mapId if already know ; otherwise null
348   * @return Integer : number
349   */
350  private function prepareCategoryMap($catId, $mapId=null)
351  {
352    global $page, $prefixeTable, $template, $user, $conf;
353
354    if($catId>0)
355    {
356      $this->category['id']=$catId;
357
358      if($mapId!=null)
359      {
360        $this->buildMapList($mapId, 'C', self::ID_MODE_MAP);
361      }
362      else
363      {
364        $this->buildMapList($catId, 'C', self::ID_MODE_CATEGORY);
365      }
366
367      // check if there is picture with gps tag in the selected category
368      $sql="SELECT paut.tagId, MAX(CAST(pait.value AS DECIMAL(20,17))) AS maxValue, MIN(CAST(pait.value AS DECIMAL(20,17))) AS minValue
369            FROM (((".USER_CACHE_CATEGORIES_TABLE." pucc
370              LEFT JOIN ".CATEGORIES_TABLE." pct ON pucc.cat_id = pct.id)
371              LEFT JOIN ".IMAGE_CATEGORY_TABLE." pic ON pic.category_id = pucc.cat_id)
372              LEFT JOIN ".$prefixeTable."amd_images_tags pait ON pait.imageId = pic.image_id)
373              LEFT JOIN ".$prefixeTable."amd_used_tags paut ON pait.numId = paut.numId
374            WHERE pucc.user_id = '".$user['id']."'
375             AND (paut.tagId = 'magic.GPS.LatitudeNum' OR paut.tagId = 'magic.GPS.LongitudeNum')
376             AND pic.image_id IS NOT NULL
377             AND FIND_IN_SET(".$catId.", pct.uppercats)!=0
378             GROUP BY paut.tagId";
379    }
380    elseif($catId==self::CAT_ID_TAGS and isset($page['items']))
381    {
382      if(count($page['items'])==0) return(false);
383      // 'tags'
384      $sql="SELECT paut.tagId, MAX(CAST(pait.value AS DECIMAL(20,17))) AS maxValue, MIN(CAST(pait.value AS DECIMAL(20,17))) AS minValue
385            FROM ".$prefixeTable."amd_images_tags pait
386                  LEFT JOIN ".$prefixeTable."amd_used_tags paut ON pait.numId = paut.numId
387            WHERE (paut.tagId = 'magic.GPS.LatitudeNum' OR paut.tagId = 'magic.GPS.LongitudeNum')
388             AND pait.imageId IN (".implode(',', $page['items']).")
389             GROUP BY paut.tagId";
390      $this->category['id']=0;
391      $this->buildMapList(0, 'C', self::ID_MODE_CATEGORY);
392    }
393    elseif($catId==self::CAT_ID_HOME)
394    {
395      // 'home'
396      $this->category['id']=0;
397      $this->buildMapList(0, 'C', self::ID_MODE_CATEGORY);
398      // check if there is picture with gps tag in the selected category
399      $sql="SELECT paut.tagId, MAX(CAST(pait.value AS DECIMAL(20,17))) AS maxValue, MIN(CAST(pait.value AS DECIMAL(20,17))) AS minValue
400            FROM (((".USER_CACHE_CATEGORIES_TABLE." pucc
401              LEFT JOIN ".CATEGORIES_TABLE." pct ON pucc.cat_id = pct.id)
402              LEFT JOIN ".IMAGE_CATEGORY_TABLE." pic ON pic.category_id = pucc.cat_id)
403              LEFT JOIN ".$prefixeTable."amd_images_tags pait ON pait.imageId = pic.image_id)
404              LEFT JOIN ".$prefixeTable."amd_used_tags paut ON pait.numId = paut.numId
405            WHERE pucc.user_id = '".$user['id']."'
406             AND (paut.tagId = 'magic.GPS.LatitudeNum' OR paut.tagId = 'magic.GPS.LongitudeNum')
407             AND pic.image_id IS NOT NULL
408             GROUP BY paut.tagId";
409    }
410    else
411    {
412      return(0);
413    }
414
415    $nb=0;
416    if(count($this->maps)>0)
417    {
418      $result=pwg_query($sql);
419      if($result)
420      {
421        while($row=pwg_db_fetch_assoc($result))
422        {
423          switch($row['tagId'])
424          {
425            case 'magic.GPS.LatitudeNum':
426              $this->category['bounds']['N']=$row['maxValue'];
427              $this->category['bounds']['S']=$row['minValue'];
428              break;
429            case 'magic.GPS.LongitudeNum':
430              $this->category['bounds']['E']=$row['maxValue'];
431              $this->category['bounds']['W']=$row['minValue'];
432              break;
433          }
434          $nb++;
435        }
436      }
437    }
438    return($nb);
439  }
440
441
442  /**
443   * this function display the map on the picture page
444   *
445   * the 'amd_jpegMD_loaded' event is triggered before the 'loc_begin_picture'
446   * event so, when this function is called the $this->picture var was already
447   * initialized
448   */
449  public function displayPicturePageMap()
450  {
451    global $page, $template;
452
453    if($this->picture['geolocated']==false and $this->picture['forceDisplay']==false) return(false);
454    if(isset($this->picture['content']['MP']) and count($this->picture['content']['MP'])>0)
455    {
456      // there is maps in meta display mode
457      $template->set_filename('gmapsMeta',
458                  dirname($this->getFileLocation()).'/templates/gmaps_picture_meta.tpl');
459      $template->assign('maps', $this->picture['content']['MP']);
460
461      $metaTitle='';
462      foreach($this->picture['content']['MP'] as $map)
463      {
464        if($metaTitle=='') $metaTitle=$map['title'];
465      }
466
467      $metadata=array
468        (
469          'TITLE' => ($metaTitle=='')?l10n('gmaps_geolocation'):$metaTitle,
470          'lines' =>
471            array(
472              /* <!--rawContent-->  is a trick to display raw data in tabs
473               * for the gally template
474               *
475               * on the default template, the displayed content is done
476               * normally
477               */
478              '<!--rawContent-->' => $template->parse('gmapsMeta', true)
479            )
480        );
481      $template->append('metadata', $metadata, false);
482    }
483
484    if(isset($this->picture['content']['IP']) and count($this->picture['content']['IP'])>0)
485    {
486      // there is maps in icon display mode
487      $template->assign('map', $this->picture['content']['IP'][0]);
488      $template->assign('mapIcon', $this->picture['icon']);
489
490      $template->set_filename('gmapsIconMap',
491                  dirname($this->getFileLocation()).'/templates/gmaps_picture_icon.tpl');
492      $template->append('footer_elements', $template->parse('gmapsIconMap', true), false);
493
494      $template->set_filename('gmapsIconButton',
495                  dirname($this->getFileLocation()).'/templates/gmaps_picture_iconbutton.tpl');
496      $template->concat('PLUGIN_PICTURE_ACTIONS',  $template->parse('gmapsIconButton', true), false);
497    }
498
499    if(count($this->picture['properties'])>0)
500    {
501      $template->append('head_elements',
502"<script type=\"text/javascript\">
503  var gmaps =
504    {
505      geolocated:".($this->picture['geolocated']?'true':'false').",
506      forceDisplay:".($this->picture['forceDisplay']?'true':'false').",
507      lang:{
508        centermap:'".l10n('gmaps_i_centermap')."',
509        boundkml:'".l10n('gmaps_i_boundkml')."'
510      },
511      coords:
512      {
513        latitude:'".$this->picture['coords']['lat']."',
514        longitude:'".$this->picture['coords']['lng']."'
515      },
516      maps:
517      [".implode(',', $this->picture['properties'])."],
518      popupAutomaticSize:".$this->config['popupAutomaticSize']."
519    };
520</script>", false);
521    }
522  }
523
524
525
526
527  /**
528   * prepare the maps for the picture page
529   *
530   * this function is called when the plugin AdvancedMetadata has finished to
531   * read the metadata ; if picture is not geolocated, there is no map to display
532   *
533   * @param JpegMetadata $jpegMD : a JpegMetadata object
534   */
535  public function preparePictureMaps($jpegMD)
536  {
537    global $template, $page, $user;
538
539    $isGeolocated=true;
540
541    if(is_null($jpegMD->getTag('magic.GPS.LatitudeNum')) or
542       is_null($jpegMD->getTag('magic.GPS.LongitudeNum'))) $isGeolocated=false;
543
544
545    if(isset($page['category']))
546    {
547      $this->buildMapList($page['category']['id'], 'P', self::ID_MODE_CATEGORY);
548    }
549    else
550    {
551      $sql="SELECT GROUP_CONCAT(pict.category_id)
552            FROM ".IMAGE_CATEGORY_TABLE." pict
553            WHERE pict.image_id=".$page['image_id'];
554      if($user['forbidden_categories']!='') $sql.=" AND pict.category_id NOT IN (".$user['forbidden_categories'].")";
555
556      $result=pwg_query($sql);
557      if($result)
558      {
559        while($row=pwg_db_fetch_row($result))
560        {
561          $cats=explode(',', $row[0]);
562        }
563      }
564
565      $cats[]=0;
566      $i=0;
567      while(count($this->maps)==0 and $i<count($cats))
568      {
569        $this->buildMapList($cats[$i], 'P', self::ID_MODE_CATEGORY);
570        $i++;
571      }
572    }
573
574    if($this->forceDisplay==0 and !$isGeolocated) return(false);
575
576    $this->picture['geolocated']=$isGeolocated;
577    $this->picture['forceDisplay']=!$isGeolocated;
578    if($isGeolocated)
579    {
580      $this->picture['coords']['lat']=$jpegMD->getTag('magic.GPS.LatitudeNum')->getValue();
581      $this->picture['coords']['lng']=$jpegMD->getTag('magic.GPS.LongitudeNum')->getValue();
582    }
583
584
585    foreach($this->maps as $map)
586    {
587      if($isGeolocated or
588         $map['forceDisplay']=='y' and ($map['kmlFileUrl']!='' or $map['kmlFileId']!=0)
589        )
590      {
591        if($map['displayType']=='IP')
592        {
593          preg_match('/^i(\d+)x(\d+).*/i', basename($map['icon']), $result);
594          $this->picture['icon']=array(
595            'iconStyle' => $map['iconStyle'],
596            'file' => $map['icon'],
597            'width' => isset($result[1])?$result[1]:-1,
598            'height' => isset($result[2])?$result[2]:-1
599          );
600        }
601
602
603        $this->picture['content'][$map['displayType']][]=array(
604          'id' => $map['id'],
605          'width' => $map['width'],
606          'height' => $map['height'],
607          'style' => $map['style'],
608          'displayType' => $map['displayType'],
609          'title' => $map['title'],
610        );
611
612        $this->picture['properties'][]="
613        {
614          id:'iGMaps".(($map['displayType']=='IP')?'Icon':$map['id'])."',
615          zoomLevel:".$map['zoomLevel'].",
616          markerImg:'".$map['marker']."',
617          mapType:'".$map['mapType']."',
618          mapTypeControl:'".$map['mapTypeControl']."',
619          navigationControl:'".$map['navigationControl']."',
620          scaleControl:'".$map['scaleControl']."',
621          streetViewControl:'".$map['streetViewControl']."',
622          kmlFileUrl:'".$map['kmlFileUrl']."',
623          displayType:'".$map['displayType']."',
624          sizeMode:'".$map['sizeMode']."',
625          title:'".addslashes( ($map['title']=='')?l10n('gmaps_geolocation'):$map['title']  )."'
626        }";
627      }
628    }
629  }
630
631
632
633
634} //class
635
636?>
Note: See TracBrowser for help on using the repository browser.