Changeset 1234

Show
Ignore:
Timestamp:
10/09/10 12:11:00 (3 years ago)
Author:
d0nut
Message:

show info window with click

Location:
g-map/files/js/gmap
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • g-map/files/js/gmap/AjaxMap.class.js

    r1233 r1234  
    1616         
    1717        /** 
    18          * called in content GMarker or ClusterMarker 
     18         *  
    1919         */ 
    20         this.fireClickEvent = function() { 
    21                 alert(this.getLatLng()); 
     20        this.fireClickEvent = function(marker) { 
     21                marker.openInfoWindowHtml(marker.getLatLng() + "\nzoom: " + this.gmap.getZoom()); 
     22                // start ajax request for ClusterMarker here 
    2223        }; 
    2324 
     
    5354                                                        } 
    5455 
    55                                                         GEvent.addListener(marker, "click", map.fireClickEvent); 
     56                                                        GEvent.addListener(marker, "click", function(map, marker) { 
     57                                                                return function() { 
     58                                                                        map.fireClickEvent(marker); 
     59                                                                }; 
     60                                                        }(map, marker)); 
    5661                                                        map.gmap.addOverlay(marker); 
    5762                                                } 
  • g-map/files/js/gmap/ClusterMarker.class.js

    r1233 r1234  
    4848        this.getLatLng = function() { 
    4949                return this.latlng_; 
    50         } 
     50        }; 
     51         
     52        this.openInfoWindowHtml = function(html) { 
     53                var window = this.map_.getInfoWindow(); 
     54                window.reset(this.getLatLng(), [new GInfoWindowTab("", html)]); 
     55                window.show(); 
     56        }; 
    5157} 
    5258