function resizeMap(map, points ) {
  var minLong = 999;
  var minLat = 999;
  var maxLong = -999;
  var maxLat = -999;
  
  // Get the current map width/height
  var size = map.getSize();
  var mapWidth = size.width;
  var mapHeight = size.height;
  var baseWidth = mapWidth;
  var baseHeight = mapHeight;
  
  // Figure out the elemental unit (depends on the size of the map)
  // You will need to re-run resizeMap() if the size of the map changes.
  if ( map.getZoom() > 0 ) {
    baseWidth /= Math.pow(4.3, map.getZoom() );
    baseHeight /= Math.pow(4.4, map.getZoom() );
  }

  // Find the max/min points
  for ( var i = 0; i < points.length; i++ ) {
  	// Ignore 0x0 as bad points
  	if ( points[i].x != 0 || points[i].y !=0) { 
	    if ( (points[i].x - 0) < (minLong - 0) ) {
	    	minLong = points[i].x;
	    }
	    if ( (points[i].x - 0) > (maxLong - 0) ) {
		    maxLong = points[i].x;
		}
	    if ( (points[i].y - 0) < (minLat - 0) ) {
	    	minLat = points[i].y;
	    }
	    if ( (points[i].y - 0) > (maxLat - 0) ) {
	    	maxLat = points[i].y;
	    }
	}
  }
  
  if (points[0].x == 0 && points[0].y == 0) {
  	// Assume non-geocoded, so only base point
  	wZoom = 5;
  	hZoom = 5;
  } else {
	    // Find the optimal Width Zoom
	  var wZoom = 16;
	  var w = Math.abs((new Number(maxLong)) - (new Number(minLong)));
	  for ( var i = 16; i >= 0; i-- ) {
	    if ( baseWidth > w ) break;
	    baseWidth *= 2;
	    wZoom = i;
	  }
	
	  // Find the optimal Height Zoom
	  var hZoom = 16;
	  var h = Math.abs((new Number(maxLat)) - (new Number(minLat)));
	  for ( var i = 16; i >= 0; i-- ) {
	    if ( baseHeight > h ) break;
	    baseHeight *= 2;
	    hZoom = i;
	  }
 }
    // Reposition
    
   var centerLatLng = new GLatLng(((new Number(minLat) + new Number(maxLat)) / 2 )+.0004, ((new Number(minLong) + new Number(maxLong))/2));
   
  map.setCenter(centerLatLng,  (wZoom < hZoom ? wZoom : hZoom));
}


//For Airport

function resizeAirportMap(map, points ) {
   // Reposition
  
 var centerLatLng = new GLatLng(points[0].y, points[0].x);
//map.setCenter(centerLatLng,1);
map.setCenter(centerLatLng,  8);
}
