public MapWidget(Bundle bundle,Context context,String rootMapFolder,int initialZoomLevel){
  super(context);
  initCommonStuff(context);
  String configPath=OfflineMapUtil.getConfigFilePath(rootMapFolder);
  try {
    MapConfigParser configParser=new MapConfigParser(rootMapFolder);
    config=configParser.parse(context,configPath);
    tileProvider=new AssetTileProvider(getContext(),config);
    int maxZoomLevel=OfflineMapUtil.getMaxZoomLevel(config.getImageWidth(),config.getImageHeight());
    int zoomLevel=initialZoomLevel;
    float scale=1.0f;
    if (bundle != null) {
      if (bundle.containsKey("com.ls.zoomLevel"))       zoomLevel=bundle.getInt("com.ls.zoomLevel");
      if (bundle.containsKey("com.ls.scale"))       scale=bundle.getFloat("com.ls.scale");
    }
    if (zoomLevel > maxZoomLevel) {
      grid=new Grid(this,config,tileProvider,maxZoomLevel);
      if (scale == 1.0f) {
        scale=(float)Math.pow(2,zoomLevel - maxZoomLevel);
      }
    }
 else {
      grid=new Grid(this,config,tileProvider,zoomLevel);
    }
    this.scale=scale;
    grid.setInternalScale(scale);
    initPositionPin();
    restoreMapPosition(bundle);
  }
 catch (  SAXException e) {
    Log.e(TAG,"Exception: " + e);
    e.printStackTrace();
  }
catch (  IOException e) {
    Log.e(TAG,"Exception: " + e);
    e.printStackTrace();
  }
}

public MapWidget ( Bundle bundle , Context context , String rootMapFolder , int initialZoomLevel ) { super ( context ) ; initCommonStuff ( context ) ; String configPath = OfflineMapUtil . getConfigFilePath ( rootMapFolder ) ; try { MapConfigParser configParser = new MapConfigParser ( rootMapFolder ) ; config = configParser . parse ( context , configPath ) ; tileProvider = new AssetTileProvider ( getContext ( ) , config ) ; int maxZoomLevel = OfflineMapUtil . getMaxZoomLevel ( config . getImageWidth ( ) , config . getImageHeight ( ) ) ; int zoomLevel = initialZoomLevel ; float scale = 1.0f ; if ( bundle != null ) { if ( bundle . containsKey ( "com.ls.zoomLevel" ) ) zoomLevel = bundle . getInt ( "com.ls.zoomLevel" ) ; if ( bundle . containsKey ( "com.ls.scale" ) ) scale = bundle . getFloat ( "com.ls.scale" ) ; } if ( zoomLevel > maxZoomLevel ) { grid = new Grid ( this , config , tileProvider , maxZoomLevel ) ; if ( scale == 1.0f ) { scale = ( float ) Math . pow ( 2 , zoomLevel - maxZoomLevel ) ; } } else { grid = new Grid ( this , config , tileProvider , zoomLevel ) ; } this . scale = scale ; grid . setInternalScale ( scale ) ; initPositionPin ( ) ; restoreMapPosition ( bundle ) ; } catch ( SAXException e ) { Log . e ( TAG , "Exception: " + e ) ; e . printStackTrace ( ) ; } catch ( IOException e ) { Log . e ( TAG , "Exception: " + e ) ; e . printStackTrace ( ) ; } }
creates instance of map widget .
