Changeset 23083


Ignore:
Timestamp:
Jun 7, 2013, 6:01:12 AM (11 years ago)
Author:
rvelices
Message:

rv_gmaps:

  • admin can choose default map type (roadmap, satellite, ...)
  • auto center and zoom when viewing map for the entire gallery
  • fix kml namespace
  • attempt to fix uage with https on the photo page (need test)
Location:
extensions/rv_gmaps/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • extensions/rv_gmaps/trunk/admin/admin_config.php

    r20515 r23083  
    4444
    4545  $gm_config['marker_icon'] = $_POST['marker_icon'];
     46        $gm_config['map_type'] = $_POST['map_type'];
     47
    4648  mkgetdir( dirname(rvm_get_config_file_name()) );
    4749  $fp = fopen( rvm_get_config_file_name(), 'w');
     
    6062      'NB_MARKERS' => rvm_get_config_var('nb_markers',40),
    6163      'NB_IMAGES_PER_MARKER' => rvm_get_config_var('nb_images_per_marker',20),
     64                        'MAP_TYPE' => rvm_get_config_var('map_type','ROADMAP'),
    6265    )
    6366  );
     
    8487    );
    8588}
     89
    8690$template->assign('selected_marker_icon', rvm_get_config_var('marker_icon', '') );
    8791
    88 
     92$map_types = array(
     93        "ROADMAP" => "Roadmap (Default)",
     94        "SATELLITE" => "Satellite",
     95        "HYBRID" => "Hybrid",
     96        "TERRAIN" => "Terrain",
     97);
     98$template->assign('map_types', $map_types);
    8999?>
  • extensions/rv_gmaps/trunk/admin/admin_config.tpl

    r15839 r23083  
    5555  </li>
    5656
     57  <li>
     58  <label>
     59    Default map type:
     60    <select name="map_type">
     61      {html_options options=$map_types selected=$MAP_TYPE}
     62    </select>
     63  </label>
     64  </li>
     65
    5766  </ul>
    5867
  • extensions/rv_gmaps/trunk/changelog.txt

    r22180 r23083  
     12.5.c
     2- admin can choose default map type (roadmap, satellite, ...)
     3- auto center and zoom when viewing map for the entire gallery
     4- fix kml namespace
     5- attempt to fix uage with https on the photo page (need test)
     6
    172.5.b
    28- more forgiving about some wrong exif gps formatting
  • extensions/rv_gmaps/trunk/include/picture_map.inc.php

    r13092 r23083  
    3434  $template->assign(
    3535    array(
     36                        'MAP_TYPE' => rvm_get_config_var('map_type', 'ROADMAP'),
    3637      'U_NO_MAP' => duplicate_picture_url(),
    3738      'U_BLOWUP' => rvm_make_blowup_url( array('ll'=>$picture), array('start','box') ),
  • extensions/rv_gmaps/trunk/main.inc.php

    r22180 r23083  
    11<?php /*
    22Plugin Name: RV Maps&Earth
    3 Version: 2.5.b
     3Version: 2.5.c
    44Description: Extend your gallery with Google Maps and Google Earth ...
    55Plugin URI: http://piwigo.org/ext/extension_view.php?eid=122
     
    77Author URI: http://www.modusoptimus.com/
    88*/
    9 define( 'RVM_PLUGIN_VERSION', '2.5.b');
     9define( 'RVM_PLUGIN_VERSION', '2.5.c');
    1010defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
    1111
     
    108108                }
    109109        }
    110         else
    111                 if ( isset($_GET['map']) )
     110        elseif ( isset($_GET['map']) )
    112111                        redirect( duplicate_picture_url() );
    113112        return $pictures;
  • extensions/rv_gmaps/trunk/map.php

    r14181 r23083  
    4848  check_restrictions($page['category']['id']);
    4949
    50 if ( !isset($_GET['ll']) and ($page['section']!='categories' or isset($page['category']) ) )
     50if ( !isset($_GET['ll']) /*and ($page['section']!='categories' or isset($page['category']) )*/ )
    5151{
    5252  $img_fields = 'MIN(i.lat) s, MIN(i.lon) w, MAX(i.lat) n, MAX(i.lon) e';
     
    6969    'CONTENT_ENCODING' => get_pwg_charset(),
    7070    'RVM_PLUGIN_VERSION' => RVM_PLUGIN_VERSION,
    71     'GMAPS_API_KEY' => $conf['gmaps_api_key'],
    7271    'PLUGIN_ROOT_URL' => get_absolute_root_url().'plugins/'.$rvm_dir,
    7372                'PLUGIN_LOCATION' => 'plugins/'.$rvm_dir,
     
    7675    'U_HOME' => make_index_url(),
    7776    'U_HOME_MAP' => rvm_make_map_index_url(),
     77                'MAP_TYPE' => rvm_get_config_var('map_type', 'ROADMAP'),
    7878  )
    7979  );
  • extensions/rv_gmaps/trunk/template/earth_kml.tpl

    r3447 r23083  
    11<?xml version="1.0" encoding="{$CONTENT_ENCODING}"?>
    2 <kml xmlns="http://earth.google.com/kml/2.2">
     2<kml xmlns="http://www.opengis.net/kml/2.2">
    33<Document>
    44        <Style id="img_normal">
     
    2727{if not empty($region)}
    2828<Region>
    29   <LatLonAltBox>
    30     <north>{$region.n}</north>
    31     <south>{$region.s}</south>
    32     <east>{$region.e}</east>
    33     <west>{$region.w}</west>
    34   </LatLonAltBox>
     29        <LatLonAltBox>
     30                <north>{$region.n}</north>
     31                <south>{$region.s}</south>
     32                <east>{$region.e}</east>
     33                <west>{$region.w}</west>
     34        </LatLonAltBox>
    3535</Region>
    3636{/if}
     
    3939{foreach from=$categories item=category}
    4040<NetworkLink>
    41   <visibility>0</visibility>
    42   <name><![CDATA[{$category.NAME}]]></name>
    43   <description><![CDATA[{$category.COMMENT}
     41        <visibility>0</visibility>
     42        <name><![CDATA[{$category.NAME}]]></name>
     43        <description><![CDATA[{$category.COMMENT}
    4444        {if not empty($category.TN_SRC)}
    45     <br/><img src="{$category.TN_SRC}" />
     45                <br/><img src="{$category.TN_SRC}" />
    4646        {/if}
    4747]]></description>
    48   <Link>
    49     <href>{$category.U_KML}</href>
    50   </Link>   
     48        <Link>
     49                <href>{$category.U_KML}</href>
     50        </Link>   
    5151{if not empty($category.region)}
    52   <Region>
    53     <LatLonAltBox>
    54       <north>{$category.region.n}</north>
    55       <south>{$category.region.s}</south>
    56       <east>{$category.region.e}</east>
    57       <west>{$category.region.w}</west>
    58     </LatLonAltBox>
    59   </Region>
    60   <TimeSpan>
    61     <begin>{$category.region.min_date}</begin>
    62     <end>{$category.region.max_date}</end>
    63   </TimeSpan>
     52        <Region>
     53                <LatLonAltBox>
     54                        <north>{$category.region.n}</north>
     55                        <south>{$category.region.s}</south>
     56                        <east>{$category.region.e}</east>
     57                        <west>{$category.region.w}</west>
     58                </LatLonAltBox>
     59        </Region>
     60        <TimeSpan>
     61                <begin>{$category.region.min_date}</begin>
     62                <end>{$category.region.max_date}</end>
     63        </TimeSpan>
    6464{/if}
    6565</NetworkLink>
  • extensions/rv_gmaps/trunk/template/map.tpl

    r22180 r23083  
    4848{
    4949        var mapOptions = {
    50                 mapTypeId: google.maps.MapTypeId.ROADMAP,
     50                mapTypeId: google.maps.MapTypeId.{/literal}{$MAP_TYPE}{literal},
    5151                overviewMapControl: true,
    5252                overviewMapControlOptions: {opened: true}
     
    5656        {
    5757{/literal}
    58                 {if isset($initial_bounds)}
     58{if isset($initial_bounds)}
    5959                mapOptions.iniBounds = new google.maps.LatLngBounds( new google.maps.LatLng({$initial_bounds.s},{$initial_bounds.w}), new google.maps.LatLng({$initial_bounds.n},{$initial_bounds.e}) );
    6060                mapOptions.center = mapOptions.iniBounds.getCenter();
    61                 {else}
    62                         mapOptions.center = new google.maps.LatLng(0,0);
    63                         mapOptions.zoom = 2;
    64                 {/if}
     61{else}
     62                mapOptions.center = new google.maps.LatLng(0,0);
     63                mapOptions.zoom = 2;
     64{/if}
    6565{literal}
    6666        }
     
    176176  <div class="titlebar_links" >
    177177    <span id="dataLoadStatus"></span>
    178     <a id="aKml" href="" type="application/vnd.google-earth.kml+xml" class="gmnoprint"><img src="http://maps.google.com/mapfiles/ms/view_as_kml.png" width="16" height="16" alt="kml"> <span>KML</span></a>
    179     <a id="aLinkToThisPage" href="" class="gmnoprint"><img src="http://maps.google.com/mapfiles/bar_icon_link.gif" alt="&lt;-&gt;" width="16" height="16"> <span>{'Link to this page'|@translate}</span></a>
     178    <a id="aKml" href="" type="application/vnd.google-earth.kml+xml" class="gmnoprint"><img src="//maps.google.com/mapfiles/ms/view_as_kml.png" width="16" height="16" alt="kml"> <span>KML</span></a>
     179    <a id="aLinkToThisPage" href="" class="gmnoprint"><img src="//maps.google.com/mapfiles/bar_icon_link.gif" alt="&lt;-&gt;" width="16" height="16"> <span>{'Link to this page'|@translate}</span></a>
    180180    <a id="aBlowup" href="" onclick="return PwgDataHandler.blowupUrl(this.href);" class="gmnoprint" title="{'show all photos around this location'|@translate}">
    181181                        <img src="{$PLUGIN_ROOT_URL}/icons/pic_s.gif" alt="" title="{'show all photos around this location'|@translate}">
  • extensions/rv_gmaps/trunk/template/page_linker.js

    r12700 r23083  
    2828        vars['ll'] = map.getCenter().toUrlValue(5);
    2929        vars['z'] = map.getZoom();
    30         if ( map.getMapTypeId()===google.maps.MapTypeId.ROADMAP )
    31                 { if (vars['t']) vars['t']=null; }
    32         else
    33                 vars['t']=map.getMapTypeId();
     30        vars['t']=map.getMapTypeId();
    3431
    3532        var url = document.location.protocol+'//'+document.location.hostname+document.location.pathname;
  • extensions/rv_gmaps/trunk/template/picture_map_content.tpl

    r22180 r23083  
    11{html_head}
    2 <script src="http://maps.googleapis.com/maps/api/js?sensor=false&amp;language={$lang_info.code}" type="text/javascript"></script>
     2<script src="//maps.googleapis.com/maps/api/js?sensor=false&amp;language={$lang_info.code}" type="text/javascript"></script>
    33{combine_script id='jquery' load='header' path='themes/default/js/jquery.min.js'}
    44{combine_script id='jquery.colorbox' load='async' require='jquery' path='themes/default/js/plugins/jquery.colorbox.min.js'}
     
    4545                zoom : 1,
    4646{/if}{literal}
    47                 mapTypeId: google.maps.MapTypeId.ROADMAP
     47                mapTypeId: google.maps.MapTypeId.{/literal}{$MAP_TYPE}{literal}
    4848        };
    4949       
Note: See TracChangeset for help on using the changeset viewer.