rem: bModPData = bModForm.points_data; alert ('Polygon drawing assistant activated for '+ bModForm.name.value + ' polygon. \n Click to draw the outline. \n\nThe final connection will automatically be \ncompleted for you, so don\'t worry about that.'); bLastpoint = null; bTempPoints = []; bTP = new GPolyline(bTempPoints); 
add: BitMap.Edit.bModPData = BitMap.Edit.bModForm.points_data; alert ('Polygon drawing assistant activated for '+ BitMap.Edit.bModForm.name.value + ' polygon. \n Click to draw the outline. \n\nThe final connection will automatically be \ncompleted for you, so don\'t worry about that.'); BitMap.Edit.bLastpoint = null; BitMap.Edit.bTempPoints = []; BitMap.Edit.bTP = new GPolyline(BitMap.Edit.bTempPoints); 
context:  BitMap.Edit.addAssistant = function(a, b){ 	removeAssistant(); 	if (a == 'polyline'){		bModForm = $('polylineform_'+b); 		bModPData = bModForm.points_data; 		alert ('Polyline drawing assistant activated for '+ bModForm.name.value + ' polyline. \n Click to Draw!');				bLastpoint = null;	  bTempPoints = [];  	bTP = new GPolyline(bTempPoints);  	Map.map.addOverlay(bTP);		//create polyline object from points and add to map    	bAssistant = GEvent.addListener(map, "click", function(overlay,point) {                		if(bLastpoint && bLastpoint.x==point.x && bLastpoint.y==point.y) return;                		bLastpoint = point;                		                		bTempPoints.push(point);                		map.removeOverlay(bTP);                		bTP = new GPolyline(bTempPoints);                		map.addOverlay(bTP);                		for(var i=0; i<bTempPoints.length; i++){											if (i == 0){												msg = bTempPoints[i].x + ', ' + bTempPoints[i].y;												}else{                				msg += ', ' + bTempPoints[i].x + ', ' + bTempPoints[i].y;											}                		}										                		bModPData.value = msg;              	});	} 	if (a == 'polygon'){		bModForm = $('polygonform_'+b);  	if (bModForm.circle.options[bModForm.circle.selectedIndex].value == 'true'){      	bModPData = bModForm.circle_center;     	alert ('Circle-Center drawing assistant activated for '+ bModForm.name.value + ' polygon. \n Click to marker the center of your circle!');            	bAssistant = GEvent.addListener(map, "click", function(overlay, point){                         if (point) {                     		Map.map.recenterOrPanToLatLng(point);                     		bModPData.value = point.x + ", " + point.y;                         }                       });  	}else{   		bModPData = bModForm.points_data;   		alert ('Polygon drawing assistant activated for '+ bModForm.name.value + ' polygon. \n Click to draw the outline. \n\nThe final connection will automatically be \ncompleted for you, so don\'t worry about that.');   		bLastpoint = null;   	 	bTempPoints = [];     	bTP = new GPolyline(bTempPoints);     	Map.map.addOverlay(bTP);		//create polyline object from points and add to map          	bAssistant = GEvent.addListener(map, "click", function(overlay,point) {                		if(bLastpoint && bLastpoint.x==point.x && bLastpoint.y==point.y) return;                		bLastpoint = point;                		                		bTempPoints.push(point);                		Map.map.removeOverlay(bTP);                		bTP = new GPolyline(bTempPoints);                		Map.map.addOverlay(bTP);                		for(var i=0; i<bTempPoints.length; i++){								if (i == 0){									msg = bTempPoints[i].x + ', ' + bTempPoints[i].y;								}else{                				msg += ', ' + bTempPoints[i].x + ', ' + bTempPoints[i].y;								}                		}										                		bModPData.value = msg;              	});		}	}		if (a == 'marker'){		bModForm = $('markerform_'+b); 		bModMLat = bModForm.marker_lat;  		bModMLon = bModForm.marker_lon; 		alert ('Marker ploting assistant activated for '+ bModForm.title.value + ' marker. \n Click to Position!');	  	bAssistant = GEvent.addListener(map, "click", function(overlay, point){      if (point) {  		if (bTP != null) {        	Map.map.removeOverlay(bTP);  		}  		bTP = new GMarker(point);  		Map.map.addOverlay(bTP);  		Map.map.recenterOrPanToLatLng(point);  		bModMLat.value = point.y;  		bModMLon.value = point.x;											      }    });	}	if (a == 'map'){		f = $('mapform');		alert ('Map centering assistant activated. \n Click to get center lat and lon values!');	  	bAssistant = GEvent.addListener(map, "click", function(overlay, point){      if (point) {  		Map.map.recenterOrPanToLatLng(point);  		f.map_lon.value = point.x;  		f.map_lat.value = point.y;      }    });	}}	
meta: 1713	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1713/cc6f22930d4e12134b6173f5ac3df158f26afdfa/Edit.js/buggy/templates/Edit.js