LandgateConfig = new Vespucci.Configuration();

//LandgateConfig.proxy =  "/cgi-bin/proxy.cgi?url=",

LandgateConfig.mapOptions = {
    units: "m"
}

LandgateConfig.wfsvUrl = "/geo/ows", //"http://geo.openplans.org/geoserver/ows",
LandgateConfig.wmsUrl = [
    "http://geo.openplans.org/geoserver/gwc/service/wms"
    //"http://artois.openplans.org/tc/tilecache.py",
];

LandgateConfig.wmsOptions = {
		layers: "nyc_background", // 
        bgcolor: '0xECECC6', 
        format: 'image/png8'
};

LandgateConfig.wfsLayerTypes = ["notes"];

LandgateConfig.featureClasses = {
    "notes":    Vespucci.Feature.Note,
    "comments": Vespucci.Feature.Comment
};

LandgateConfig.featureDefaults = {
    "notes": {
        title: "Note",
        content: "This is a note.",
        typeid : 0
    }  
};

LandgateConfig.icons = [Vespucci.ImgPath + "ped.png", 
                      Vespucci.ImgPath + "bike.png", 
                      Vespucci.ImgPath + "elderly.png", 
                      Vespucci.ImgPath + "kids.png",
                      Vespucci.ImgPath + "publicspace.png",
                      Vespucci.ImgPath + "traffic.png",
                      Vespucci.ImgPath + "parking.png",
                      Vespucci.ImgPath + "truck.png",
                      Vespucci.ImgPath + "transit.png"];
					  
LandgateConfig.featureStyles = {
    "notes": {
        externalGraphic: LandgateConfig.icons[0],
        // Shadows taken out (for now) because they caused more problems then they solved.
        backgroundGraphic: Vespucci.ImgPath + "project_shadow.png",
        backgroundXOffset: 0,
        backgroundYOffset: -23,
        backgroundGraphicZIndex: 1,
        graphicOpacity: 1,
        // graphicYOffset is *almost* the height of the externalGraphic.
        // -30 was chosen because it seemed to best match the feature's
        // lonlat visually when the map was zoomed out.
        graphicYOffset: -30,  
        graphicZIndex: 10,
        fillColor: "#ee9900",
        fillOpacity: 0, 
        hoverFillColor: "white",
        hoverFillOpacity: 0,
        strokeColor: "#ee9900",
        strokeOpacity: 0,
        strokeWidth: 1,
        strokeLinecap: "round",
        hoverStrokeColor: "red",
        hoverStrokeOpacity: 0,
        hoverStrokeWidth: 0.2,
        pointRadius: 15,
        hoverPointRadius: 1,
        hoverPointUnit: "%",
        pointerEvents: "visiblePainted"
    }
}

LandgateConfig.addControls = {
    "notes": Vespucci.GeometryType.Point
};

LandgateConfig.moveControls = {
    "notes": Vespucci.GeometryType.Point
};

LandgateConfig.subtypes = {
	"notes" : [
		{ //An object with the parameters for this subtype 
			name : "Pedestrian",
			attributes : { // necessary and sufficient attributes for this subtype
				typeid : 0
			},
			style : { // OpenLayers styles to override default feature type styles
				externalGraphic : LandgateConfig.icons[0]
			}
		},
		{	
			name : "Cyclist",
			attributes : { 
				typeid : 1
			},
			style : {
				externalGraphic : LandgateConfig.icons[1]
			}
		},
		{	
			name : "Elderly",
			attributes : { 
				typeid : 2
			},
			style : {
				externalGraphic : LandgateConfig.icons[2]
			}
		},
		{	
			name : "Kids/Schools",
			attributes : { 
				typeid : 3
			},
			style : {
				externalGraphic : LandgateConfig.icons[3]
			}
		},
		{	
			name : "Public Space Opportunities",
			attributes : { 
				typeid : 4
			},
			style : {
				externalGraphic : LandgateConfig.icons[4]
			}
		},
		{	
			name : "Traffic",
			attributes : { 
				typeid : 5
			},
			style : {
				externalGraphic : LandgateConfig.icons[5]
			}
		},
		{	
			name : "Parking",
			attributes : { 
				typeid : 6
			},
			style : {
				externalGraphic : LandgateConfig.icons[6]
			}
		},
		{	
			name : "Trucks",
			attributes : { 
				typeid : 7
			},
			style : {
				externalGraphic : LandgateConfig.icons[7]
			}
		},
		{	
			name : "Transit",
			attributes : { 
				typeid : 8
			},
			style : {
				externalGraphic : LandgateConfig.icons[8]
			}
		}
	] 
};

LandgateConfig.namespaceUri = "http://www.openplans.org/topp";
LandgateConfig.namespace = "topp";

LandgateConfig.projection = "EPSG:900913";

/*
 * Be careful about changing this maxExtent.
 * 
 * This needs to line up with the "world wide grid" used for EPSG:900913 on the tiling server.
 */ 
LandgateConfig.maxExtent = new OpenLayers.Bounds(-8296780.797031253,4852834.05109375,-8140237.763125002,5009377.085);

LandgateConfig.maxResolution = 38.21851413574219;

LandgateConfig.defaultZoomLevel = 2;
LandgateConfig.defaultZoomCenter = new OpenLayers.LonLat(-8233844.45887568, 4980388.342026915);

LandgateConfig.defaultDiffViewZoomLevel = 5;

LandgateConfig.startInViewMode = false;

LandgateConfig.margins = new OpenLayers.Bounds(0, 0, 0, 0);
LandgateConfig.popupMargins = new OpenLayers.Bounds(75, 0, 0, 35);

LandgateConfig.peopleUrlPrefix = "http://design.livablestreets.com/people/";
LandgateConfig.peopleUrlSuffix = "/profile";

LandgateConfig.notRegisteredUrl = "http://design.livablestreets.com/join";
LandgateConfig.forgotCredentialsUrl = "http://design.livablestreets.com/forgot";

LandgateConfig.loginHandlerClass = Vespucci.LoginHandler.LivableStreets.Stage;

var NYCMap;
        
function loadNYCMap() {
    NYCMap = new Vespucci.Application(LandgateConfig);
    NYCMap.load();
}
        
