Changeset 178 for trunk


Ignore:
Timestamp:
09/21/2008 12:18:10 AM (4 years ago)
Author:
winner
Message:

Fix: choosing from config file the enabled google map types.
Add: psysical google map type.
Add: google maps localization.
Fix: reduce IE memory leaks from google maps (GUnload function).

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/config-sample/config.php

    r173 r178  
    7272                'maps_available' => array( 
    7373                        'satellite' => true, 
    74                         'normal' => false, 
    75                         'hybrid' => false, 
    76                         //Sample scripts for custom image map server can be found in the tools subdirectory 
     74                        'normal' => true, 
     75                        'hybrid' => true, 
     76                                                'physical' => true, 
     77 
     78                                                //Sample scripts for custom image map server can be found in the tools subdirectory 
    7779                        /*'custom_maps' => array( 
    7880                              0 => array( 
     
    8789                                        ), 
    8890                                ),*/ 
    89                         'default' => 'satellite' 
     91                         
     92                        'default' => 'hybrid' 
    9093                        ), 
    9194                'api' => '2.66', 
  • trunk/globals/functions.php

    r172 r178  
    337337 
    338338function include_gmap($javascript) { 
    339         global $main, $vars; 
     339        global $main, $vars, $lang; 
    340340        $dirname = dirname($_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']); 
    341341        $gmap_key = $vars['gmap']['keys'][$dirname]; 
     
    345345        if ($gmap_key == '') return FALSE; 
    346346 
    347         $main->html->head->add_script("text/javascript", "http://".$vars['gmap']['server']."/maps?file=api&v=".$vars['gmap']['api']."&key=".$gmap_key); 
     347        $main->html->head->add_script("text/javascript", "http://".$vars['gmap']['server']."/maps?file=api&v=".$vars['gmap']['api']."&key=".$gmap_key."&hl=".$lang["iso639"]); 
    348348        $main->html->head->add_script("text/javascript", $javascript); 
    349349        $main->html->head->add_extra( 
     
    355355         
    356356        $main->html->body->tags['onload'] = "gmap_onload()";     
     357    $main->html->body->tags['onunload'] = "GUnload()"; //added to reduce IE memory leaks 
    357358        return TRUE; 
    358359} 
  • trunk/templates/basic/includes/pages/gmap/gmap_js.tpl

    r176 r178  
    131131                {/foreach} 
    132132                {literal} 
    133                 var map_types = [{/literal}{$map_types|upper}{literal}]; 
    134                 map = new GMap2(document.getElementById("map")); 
    135                 if(map_types.length > 1) 
    136                                 map.addControl(new GMapTypeControl()); 
    137                 map.addControl(new GLargeMapControl()); 
    138                 //map.addControl(new GOverviewMapControl()); 
     133        gmapOptions = { 
     134                mapTypes: [{/literal}{$map_types|upper}{literal}] 
     135        } 
     136        map = new GMap2(document.getElementById("map"), gmapOptions); 
     137        if(gmapOptions.mapTypes.length > 1) 
     138                        map.addControl(new GMapTypeControl()); 
     139        map.addControl(new GLargeMapControl()); 
     140        //map.addControl(new GOverviewMapControl()); 
    139141                var center = new GLatLng({/literal}{$center_latitude}{literal},{/literal}{$center_longitude}{literal}); 
    140142                if ('{/literal}{$zoom}{literal}' != '') { 
Note: See TracChangeset for help on using the changeset viewer.