<commit_before>/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
 * See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
 * text of the license. */

// @require: OpenLayers/Layer.js


if (typeof GMap2 != "undefined") {
    
    /** Hack-on function because GMAPS does not give it to us
     * 
     * @param {GLatLng} gLatLng 
     *
     * @returns A GPoint specifying gLatLng translated into "Container" coords
     * @type GPoint
     */
    GMap2.prototype.fromLatLngToContainerPixel = function(gLatLng) {
    
        // first we translate into "DivPixel"
        var gPoint = this.fromLatLngToDivPixel(gLatLng);
    
        // locate the sliding "Div" div
        //  it seems like "b" is the main div
        var div = this.b.firstChild.firstChild;
    
        // adjust by the offset of "Div" and voila!
        gPoint.x += div.offsetLeft;
        gPoint.y += div.offsetTop;
    
        return gPoint;
    };
}

/**
 * @class
 */
OpenLayers.Layer.Google = Class.create();
OpenLayers.Layer.Google.prototype = Object.extend( new OpenLayers.Layer(), {

    /** @type Boolean */
    isFixed: true,

    /** @type GMap2 gmap stores the Google Map element */
    gmap:null,
   
    /** @type Boolean */
    dragging:false,
    
  // OPTIONS

    /** @type int */
    minZoomLevel: -1,
    
    /** @type int */
    maxZoomLevel: 16,

    
    /** 
     * @constructor
     * 
     * @param {String} name
     */
    initialize: function(name, options) {
        OpenLayers.Layer.prototype.initialize.apply(this, arguments);
        
        if (this.maxExtent == null) {
            this.maxExtent = new OpenLayers.Bounds(-180, -90, 180, 90);
        }
    },
    
     /** 
     * @param {OpenLayers.Map} map<commit_msg>give google layer a destroy() function<commit_after>/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
 * See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
 * text of the license. */

// @require: OpenLayers/Layer.js


if (typeof GMap2 != "undefined") {
    
    /** Hack-on function because GMAPS does not give it to us
     * 
     * @param {GLatLng} gLatLng 
     *
     * @returns A GPoint specifying gLatLng translated into "Container" coords
     * @type GPoint
     */
    GMap2.prototype.fromLatLngToContainerPixel = function(gLatLng) {
    
        // first we translate into "DivPixel"
        var gPoint = this.fromLatLngToDivPixel(gLatLng);
    
        // locate the sliding "Div" div
        //  it seems like "b" is the main div
        var div = this.b.firstChild.firstChild;
    
        // adjust by the offset of "Div" and voila!
        gPoint.x += div.offsetLeft;
        gPoint.y += div.offsetTop;
    
        return gPoint;
    };
}

/**
 * @class
 */
OpenLayers.Layer.Google = Class.create();
OpenLayers.Layer.Google.prototype = Object.extend( new OpenLayers.Layer(), {

    /** @type Boolean */
    isFixed: true,

    /** @type GMap2 gmap stores the Google Map element */
    gmap:null,
   
    /** @type Boolean */
    dragging:false,
    
  // OPTIONS

    /** @type int */
    minZoomLevel: -1,
    
    /** @type int */
    maxZoomLevel: 16,

    
    /** 
     * @constructor
     * 
     * @param {String} name
     */
    initialize: function(name, options) {
        OpenLayers.Layer.prototype.initialize.apply(this, arguments);
        
        if (this.maxExtent == null) {
            this.maxExtent = new OpenLayers.Bounds(-180, -90, 180, 90);
        }
    },
    
    /**
     * 
     */
    destroy: function() {
        this.gmap = null;
        OpenLayers.Layer.prototype.destroy.apply(this, arguments); 
    },

     /** 
     * @param {OpenLayers.Map} map
{'fraction_non_alphanumeric': 0.12745890595526813, 'fraction_numerical': 0.010778765831312315, 'mean_word_length': 2.022801302931596, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6515046', 'n_tokens_mistral': 1252, 'n_tokens_neox': 1178, 'n_words': 296}