rem: var result = copy_obj( map.mapTypes[baseid] ); 
add: var result = copy_obj( Map.map.mapTypes[baseid] ); 
context: 	 BitMap.Edit.addMapType = function(rslt){	    //@todo change this - bad harding coded ref to the map data - not nice      var Map = BitMap.MapData[0].Map;            var xml = rslt.responseXML;			// create a spot for a new maptype in the data array			var n = Map.Maptypes.length;			Map.Maptypes[n] = new Array();			//@todo there are several more values to add, update when updated maptype stuff globally			// assign map type values data array						var id = xml.documentElement.getElementsByTagName('maptype_id');			  		Map.Maptypes[n].maptype_id = parseInt( id[0].firstChild.nodeValue );			var nm = xml.documentElement.getElementsByTagName('name');			  		Map.Maptypes[n].name = nm[0].firstChild.nodeValue;			var ds = xml.documentElement.getElementsByTagName('description');			  		Map.Maptypes[n].description = ds[0].firstChild.nodeValue;			var cr = xml.documentElement.getElementsByTagName('copyright');			  		Map.Maptypes[n].copyright = cr[0].firstChild.nodeValue;			var bt = xml.documentElement.getElementsByTagName('basetype');  		Map.Maptypes[n].basetype = parseInt( bt[0].firstChild.nodeValue );			var at = xml.documentElement.getElementsByTagName('alttype');  		Map.Maptypes[n].alttype = parseInt( at[0].firstChild.nodeValue );			var bd = xml.documentElement.getElementsByTagName('bounds');			  		Map.Maptypes[n].bounds = bd[0].firstChild.nodeValue;			var mz = xml.documentElement.getElementsByTagName('maxzoom');  		Map.Maptypes[n].maxzoom = parseInt( mz[0].firstChild.nodeValue );			var mt = xml.documentElement.getElementsByTagName('maptiles_url');			  		Map.Maptypes[n].maptiles_url = mt[0].firstChild.nodeValue;			var lrmt = xml.documentElement.getElementsByTagName('lowresmaptiles_url');			  		Map.Maptypes[n].lowresmaptiles_url = lrmt[0].firstChild.nodeValue;			var ht = xml.documentElement.getElementsByTagName('hybridtiles_url');			  		Map.Maptypes[n].hybridtiles_url = ht[0].firstChild.nodeValue;			var lrht = xml.documentElement.getElementsByTagName('lowreshybridtiles_url');			  		Map.Maptypes[n].lowreshybridtiles_url = lrht[0].firstChild.nodeValue;						Map.Maptypes[n].maptype_node = map.mapTypes.length;						// attach the new map type to the map			var baseid = Map.Maptypes[n].basetype;			var typeid = Map.Maptypes[n].maptype_id;			var typename = Map.Maptypes[n].name;			var result = copy_obj( map.mapTypes[baseid] );			result.baseUrls = new Array();			result.baseUrls[0] = Map.Maptypes[n].maptiles_url;			result.typename = Map.Maptypes[n].name;			result.getLinkText = function() { return this.typename; };			map.mapTypes[map.mapTypes.length] = result;			Map.Maptypes[typename] = result;						// set the map type to active			map.setMapType(Map.Maptypes[typename]);			// update the controls  		map.removeControl(typecontrols);  		map.addControl(typecontrols);			// clear the form			$('maptypeform_new').reset();			// update the sets menus			BitMap.Edit.editMapTypes();	 }
meta: 1713	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1713/cc6f22930d4e12134b6173f5ac3df158f26afdfa/Edit.js/buggy/templates/Edit.js