// funzione di inizializzazione della mappa

function init() {
 
 map = new OpenLayers.Map('map', {
            numZoomLevels: 12,
            controls:[
                      new OpenLayers.Control.Navigation(),
                      new OpenLayers.Control.PanZoom(),
//                       new OpenLayers.Control.LayerSwitcher(),
                      new OpenLayers.Control.ScaleLine()
//                       new OpenLayers.Control.Scale()
            ],
            maxResolution: stMap.maxResolution,
            maxExtent: stMap.sTExt,
            projection: stMap.projection,
            units: stMap.units
            });
            
//             map.addControl( new OpenLayers.Control.LoadingPanel({minSize: new OpenLayers.Size(600, 600)}) );

        map.addLayer(base);

    for (var tp in legDbTipo){
//       if (tp == tipo){
        map.addLayer(punti[tp]);
//       }
    }


if (xmap && ymap && zoommap){
  map.setCenter(new OpenLayers.LonLat(xmap, ymap), zoommap);
}else{
  map.setCenter(new OpenLayers.LonLat(1621305, 4839254.5), 0);
}


}

// funzione per zoomare alla caratteristica

function zoomToMarker(id){
  map.setCenter(new OpenLayers.LonLat(features[id].geometry.x,features[id].geometry.y),11);
  showPopup(f[id]);
}








