{"size": 1890, "ext": "js", "max_stars_repo_path": "public-build/lib/openlayers/OpenLayers-2.13.1/lib/OpenLayers/Control/ArgParser.js", "max_stars_repo_name": "nickbenes/GeoSense", "max_stars_repo_stars_event_min_datetime": "2015-03-17T18:31:06.000Z", "max_stars_repo_stars_event_max_datetime": "2019-02-22T02:57:45.000Z", "max_issues_repo_path": "public-build/lib/openlayers/OpenLayers-2.13.1/lib/OpenLayers/Control/ArgParser.js", "max_issues_repo_name": "nickbenes/GeoSense", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "public-build/lib/openlayers/OpenLayers-2.13.1/lib/OpenLayers/Control/ArgParser.js", "max_forks_repo_name": "nickbenes/GeoSense", "max_forks_repo_forks_event_min_datetime": "2019-06-28T13:16:49.000Z", "max_forks_repo_forks_event_max_datetime": "2019-08-08T11:59:43.000Z"}
{"max_stars_count": 5, "max_issues_count": null, "max_forks_count": 2, "avg_line_length": 315.0, "max_line_length": 1637, "alphanum_fraction": 0.7772486772}
/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
 * full list of contributors). Published under the 2-clause BSD license.
 * See license.txt in the OpenLayers distribution or repository for the
 * full text of the license. */

OpenLayers.Control.ArgParser=OpenLayers.Class(OpenLayers.Control,{center:null,zoom:null,layers:null,displayProjection:null,getParameters:function(e){e=e||window.location.href;var t=OpenLayers.Util.getParameters(e),n=e.indexOf("#");return n>0&&(e="?"+e.substring(n+1,e.length),OpenLayers.Util.extend(t,OpenLayers.Util.getParameters(e))),t},setMap:function(e){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var t=0,n=this.map.controls.length;t<n;t++){var r=this.map.controls[t];if(r!=this&&r.CLASS_NAME=="OpenLayers.Control.ArgParser"){r.displayProjection!=this.displayProjection&&(this.displayProjection=r.displayProjection);break}}if(t==this.map.controls.length){var i=this.getParameters();i.layers&&(this.layers=i.layers,this.map.events.register("addlayer",this,this.configureLayers),this.configureLayers()),i.lat&&i.lon&&(this.center=new OpenLayers.LonLat(parseFloat(i.lon),parseFloat(i.lat)),i.zoom&&(this.zoom=parseFloat(i.zoom)),this.map.events.register("changebaselayer",this,this.setCenter),this.setCenter())}},setCenter:function(){this.map.baseLayer&&(this.map.events.unregister("changebaselayer",this,this.setCenter),this.displayProjection&&this.center.transform(this.displayProjection,this.map.getProjectionObject()),this.map.setCenter(this.center,this.zoom))},configureLayers:function(){if(this.layers.length==this.map.layers.length){this.map.events.unregister("addlayer",this,this.configureLayers);for(var e=0,t=this.layers.length;e<t;e++){var n=this.map.layers[e],r=this.layers.charAt(e);r=="B"?this.map.setBaseLayer(n):(r=="T"||r=="F")&&n.setVisibility(r=="T")}}},CLASS_NAME:"OpenLayers.Control.ArgParser"});