Changeset 1230

Show
Ignore:
Timestamp:
09/26/10 19:15:59 (3 years ago)
Author:
d0nut
Message:

finished gmap 2 rc 2

  • street view control
  • display clustered markers
Location:
g-map
Files:
4 added
5 modified

Legend:

Unmodified
Added
Removed
  • g-map/de.xml

    r1226 r1230  
    2222        </category> 
    2323        <category name="wcf.map"> 
    24                 <item name="wcf.map.copyright.small"><![CDATA[Karten Erweiterung, easy-coding.de]]></item> 
     24                <item name="wcf.map.copyright.small"><![CDATA[Karten Programmierung, easy-coding.de]]></item> 
    2525        </category> 
    2626</language> 
  • g-map/en.xml

    r1226 r1230  
    2222        </category> 
    2323        <category name="wcf.map"> 
    24                 <item name="wcf.map.copyright.small"><![CDATA[Map Extension, easy-coding.de]]></item> 
     24                <item name="wcf.map.copyright.small"><![CDATA[Map Development, easy-coding.de]]></item> 
    2525        </category> 
    2626</language> 
  • g-map/files/lib/system/event/listener/GMapUserPageListener.class.php

    r1229 r1230  
    3737                 
    3838                // read personal maps 
    39                 if(false) { // TODO: feature disabled for the moment 
    40                         $sql = 'SELECT          mapID 
    41                                 FROM            wcf'.WCF_N.'_gmap_personal 
    42                                 WHERE           userID = '.intval($this->userID); 
    43                         $result = WCF::getDB()->sendQuery($sql); 
    44                         while ($row = WCF::getDB()->fetchArray($result)) { 
    45                                 $this->personal_maps[] = $row; 
    46                         } 
     39                $sql = 'SELECT          mapID 
     40                        FROM            wcf'.WCF_N.'_gmap_personal 
     41                        WHERE           userID = '.intval($this->userID); 
     42                $result = WCF::getDB()->sendQuery($sql); 
     43                while ($row = WCF::getDB()->fetchArray($result)) { 
     44                        $this->personal_maps[] = $row; 
    4745                } 
    4846        } 
     
    5856 
    5957                // if user is owner or user has personal maps 
     58                // TODO: feature disabled for the moment 
    6059                if(false && WCF::getUser()->userID == $this->userID || $this->personal_maps) { 
    6160                        WCF::getTPL()->append('additionalContents3', WCF::getTPL()->fetch('userProfileMapCenter')); 
  • g-map/package.xml

    r1228 r1230  
    99                <packagedescription language="tr"><![CDATA[Bu Paket Foruma Google-Map Haritasi Ekler.]]></packagedescription> 
    1010                <isunique>1</isunique> 
    11                 <version>2.0.0 RC 1</version> 
     11                <version>2.0.0 RC 2</version> 
    1212                <date>DATE</date> 
    1313                <plugin>com.woltlab.wcf</plugin> 
     
    4545        <instructions type="update" fromversion="2.0.0 RC 1"> 
    4646                <files>files.tar</files> 
     47                <templates>templates.tar</templates> 
     48                <languages languagecode="de">de.xml</languages> 
     49                <languages languagecode="en">en.xml</languages> 
    4750        </instructions> 
    4851</package> 
  • g-map/templates/mapOverview.tpl

    r1227 r1230  
    55        {include file='headInclude' sandbox=false} 
    66        {include file='gmapConstants'} 
     7        <script type="text/javascript"> 
     8        //<![CDATA[ 
     9        GMAP_ZOOM = 5; 
     10        GMAP_ENABLE_STREETVIEW = 1;  
     11        GMAP_MAP_CONTROL = 'off'; 
     12        //]]> 
     13        </script> 
    714        <script src="{@RELATIVE_WCF_DIR}js/gmap/Map.class.js" type="text/javascript"></script> 
    815        <script type="text/javascript" src="{@RELATIVE_WCF_DIR}js/AjaxRequest.class.js"></script> 
    916        <script type="text/javascript"> 
    10                 //<![CDATA[ 
    11                 if (GMAP_API_KEY != '')  {  
    12                         document.write('<script src="http://maps.google.com/maps?file=api&amp;v=2.118&amp;hl={@$this->language->getLanguageCode()}&amp;key=' + GMAP_API_KEY + '&amp;oe={CHARSET}" type="text/javascript"><\/script>'); 
    13                         onloadEvents.push(function() { 
    14                                 if (GBrowserIsCompatible()) { 
    15  
    16                                         var AjaxMap = function(url, divID, switchable) { 
    17                                                 this.url = url; 
    18                                                 this.constructor(divID, switchable); 
    19  
    20                                                 this.update = function() { 
    21                                                         url = this.url; 
    22                                                          
    23                                                         if(this.mapInitialized) { 
    24                                                                 url += '&zoom='+this.gmap.getZoom(); 
    25                                                                 url += '&bounds='+this.gmap.getBounds(); 
    26                                                                 url += '&initialized=1'; 
    27                                                         } 
    28  
    29                                                         var ajaxRequest = new AjaxRequest(); 
    30                                                         ajaxRequest.openGet(url + SID_ARG_2ND, function(map) { 
    31                                                                 return function() { 
    32                                                                         if(ajaxRequest.xmlHttpRequest.readyState == 4 && ajaxRequest.xmlHttpRequest.status == 200) { 
    33                                                                                 var data = eval('(' + ajaxRequest.xmlHttpRequest.responseText + ')'); 
    34                                                                                 var coordinates; 
    35  
    36                                                                                 if(map.mapInitialized) { 
    37                                                                                         map.gmap.clearOverlays(); 
    38                                                                                         for(var i in data) { 
    39                                                                                                 coordinates = new GLatLng(data[i].lat, data[i].lon); 
    40                                                                                                 map.gmap.addOverlay(new GMarker(coordinates)); 
    41                                                                                         } 
    42                                                                                 } else { 
    43                                                                                         coordinates = new GLatLng(data[0].lat, data[0].lon); 
    44                                                                                         map.setCoordinates(coordinates); 
    45                                                                                         map.gmap.clearOverlays(); 
    46                                                                                          
    47                                                                                         map.update(); 
    48                                                                                         map.setEvents(); 
    49                                                                                 } 
    50                                                                         } 
    51                                                                 }; 
    52                                                         }(this)); 
    53                                                 }; 
    54                                                  
    55                                                 this.setEvents = function() { 
    56                                                         GEvent.addListener(this.gmap, "moveend", function(map) { 
    57                                                                 return function() { 
    58                                                                         map.update(); 
    59                                                                 } 
    60                                                         }(this)); 
    61                                                 } 
    62                                         }; 
    63                                         AjaxMap.prototype = new Map(); 
    64  
    65                                         gmap = new AjaxMap('index.php?page=MapAjax', 'gmap'); 
    66                                         gmap.update(); 
    67                                 } 
    68                         }); 
    69                 } 
    70                 //]]> 
     17        //<![CDATA[ 
     18        if (GMAP_API_KEY != '')  {  
     19                document.write('<script src="http://maps.google.com/maps?file=api&amp;v=2.118&amp;hl={@$this->language->getLanguageCode()}&amp;key=' + GMAP_API_KEY + '&amp;oe={CHARSET}" type="text/javascript"><\/script>'); 
     20                document.write('<script src="{@RELATIVE_WCF_DIR}js/gmap/ClusterMarker.class.js" type="text/javascript"><\/script>'); 
     21                document.write('<script src="{@RELATIVE_WCF_DIR}js/gmap/StreetViewControl.class.js" type="text/javascript"><\/script>'); 
     22                document.write('<script src="{@RELATIVE_WCF_DIR}js/gmap/AjaxMap.class.js" type="text/javascript"><\/script>'); 
     23                onloadEvents.push(function() { 
     24                        if (GBrowserIsCompatible()) { 
     25                                gmap = new AjaxMap('index.php?page=MapAjax', 'gmap'); 
     26                                gmap.registerEvent(function(map) { 
     27                                        return function() { 
     28                                                if(GMAP_ENABLE_STREETVIEW) map.gmap.addControl(new StreetViewControl()); 
     29                                        } 
     30                                }(gmap)); 
     31                                gmap.update(); 
     32                        } 
     33                }); 
     34        } 
     35        //]]> 
    7136        </script> 
    7237</head>