/[drupal]/contributions/modules/mappingkit/openlayers/openlayers.mapclient.inc
ViewVC logotype

Diff of /contributions/modules/mappingkit/openlayers/openlayers.mapclient.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.19, Mon Jun 30 13:01:03 2008 UTC revision 1.1.2.20, Tue Jul 1 06:22:46 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: openlayers.mapclient.inc,v 1.1.2.18 2008/06/30 10:03:03 openwereld Exp $  // $Id: openlayers.mapclient.inc,v 1.1.2.19 2008/06/30 13:01:03 openwereld Exp $
3    
4  /**  /**
5   * Initialize header.   * Initialize header.
# Line 59  function openlayers_init_header() { Line 59  function openlayers_init_header() {
59      drupal_add_js(drupal_get_path('module', 'openlayers') .'/custom/PrintContext.Control.js', 'extra', 'header');      drupal_add_js(drupal_get_path('module', 'openlayers') .'/custom/PrintContext.Control.js', 'extra', 'header');
60      drupal_add_js(drupal_get_path('module', 'openlayers') .'/custom/FeatureInfo.Control.js', 'extra', 'header');      drupal_add_js(drupal_get_path('module', 'openlayers') .'/custom/FeatureInfo.Control.js', 'extra', 'header');
61      drupal_add_js(drupal_get_path('module', 'openlayers') .'/custom/ZoomToExtent.Control.js', 'extra', 'header');      drupal_add_js(drupal_get_path('module', 'openlayers') .'/custom/ZoomToExtent.Control.js', 'extra', 'header');
62        drupal_add_js(drupal_get_path('module', 'openlayers') .'/custom/LayerSwitcher.Control.js', 'extra', 'header');
63    
64      // add custom javascript code      // add custom javascript code
65      $js = "\nwindow.\$ = window.jQuery;\n"; // prevent OpenLayers from overwriting $      $js = "\nwindow.\$ = window.jQuery;\n"; // prevent OpenLayers from overwriting $
# Line 535  function openlayers_finish($map_count) { Line 536  function openlayers_finish($map_count) {
536              $js .= "layer_options.opacity = 1.0;\n";              $js .= "layer_options.opacity = 1.0;\n";
537              $js .= "layer_options.displayInLegend = true;\n";              $js .= "layer_options.displayInLegend = true;\n";
538              if (isset($layer[4])) {              if (isset($layer[4])) {
539                $keylen = strpos($layer[4], '=');                $extras = explode(',', $layer[4]);
540                $key = substr($layer[4], 0, $keylen);                foreach ($extras as $extra) {
541                $value = substr($layer[4], $keylen + 1);                  $keylen = strpos($extra, '=');
542                if ($key == 'legendurl') {                  $key = substr($extra, 0, $keylen);
543                  $js .= "layer_options.legend = {};\n";                  $value = substr($extra, $keylen + 1);
544                  $js .= "layer_options.legend.href = '{$value}';\n";                  if ($key == 'legendurl') {
545                      $js .= "layer_options.legend = {};\n";
546                      $js .= "layer_options.legend.href = '{$value}';\n";
547                    }
548                    else if ($key == 'visibility') {
549                      $js .= "layer_options.visibility = $value;\n";
550                    }
551                }                }
552              }              }
553    
# Line 569  function openlayers_finish($map_count) { Line 576  function openlayers_finish($map_count) {
576      // (5) controls      // (5) controls
577      $controls = explode(',', (isset($map['controls']) ? $map['controls'] : ''));      $controls = explode(',', (isset($map['controls']) ? $map['controls'] : ''));
578      // add layer switcher      // add layer switcher
579      $js .= "map.addControl(new OpenLayers.Control.LayerSwitcher({title: Drupal.t('Layer switcher'), 'outsideViewport': true}));\n";      $js .= "map.addControl(new MappingKit.Control.LayerSwitcher({title: Drupal.t('Layer switcher')}));\n";
580      // scale line      // scale line
581      $js .= "map.addControl(new OpenLayers.Control.ScaleLine());\n";      $js .= "map.addControl(new OpenLayers.Control.ScaleLine());\n";
582    

Legend:
Removed from v.1.1.2.19  
changed lines
  Added in v.1.1.2.20

  ViewVC Help
Powered by ViewVC 1.1.2