poly = new OMPoly(vertPoints[i], OMGraphic.DECIMAL_DEGREES, OMGraphic.LINETYPE_GREATCIRCLE); poly.setLinePaint(distanceGridPaint); list.add(poly);
poly = new PolylineGeometry.LL(vertPoints[i], OMGraphic.DECIMAL_DEGREES, OMGraphic.LINETYPE_GREATCIRCLE); polys.add(poly);
    protected OMGraphicList createEquiDistanceLines(UTMPoint utm, int gridLineInterval) {	OMGraphicList list = new OMGraphicList();	// Used to calculate the endpoints of the horizontal lines.	UTMPoint utm1 = new UTMPoint(utm);	UTMPoint utm2 = new UTMPoint(utm);	LatLonPoint point1 = new LatLonPoint();	LatLonPoint point2 = new LatLonPoint();	// Used to calculate the pieces of the vertical lines.	UTMPoint utmp = new UTMPoint(utm);	LatLonPoint llp = new LatLonPoint();	int i;	OMLine line;	OMPoly poly;	float lat2; 	int endNorthing = (int) Math.floor(utm.northing/INTERVAL_100K) + 10; 	int startNorthing = (int) Math.floor(utm.northing/INTERVAL_100K) - 10;	int numVertLines = 9;	int numHorLines = endNorthing - startNorthing;	float[][] vertPoints = new float[numVertLines][numHorLines * 2];	if (UTM_DEBUG_VERBOSE) {	    Debug.output("Array is [" + vertPoints.length + "][" + vertPoints[0].length + "]");	}	int coordCount = 0;	boolean doPolys = true;	utm1.easting = INTERVAL_100K;	utm2.easting = 9 * INTERVAL_100K;	// Horizontal lines	for (i = startNorthing; i < endNorthing; i++) {	    utm1.northing = (float) i * gridLineInterval;	    utm2.northing = utm1.northing;	    utmp.northing = utm1.northing;	    if (doPolys) {		for (int j = 0; j < numVertLines; j++) {		    utmp.easting = (float) (j+1) * gridLineInterval;		    llp = utmp.toLatLonPoint(Ellipsoid.WGS_84, llp);		    vertPoints[j][coordCount] = llp.getLatitude();		    vertPoints[j][coordCount+1] = llp.getLongitude();		    if (UTM_DEBUG_VERBOSE) {			Debug.output("for vline " + j + ", point " + i +				     ", easting: " + utmp.easting + 				     ", northing: " + utmp.northing + 				     ", lat:" + vertPoints[j][coordCount] + 				     ", lon:" + vertPoints[j][coordCount+1] );		    }		}		coordCount+=2;	    }	    point1 = utm1.toLatLonPoint(Ellipsoid.WGS_84, point1);	    point2 = utm2.toLatLonPoint(Ellipsoid.WGS_84, point2);	    lat2 = point1.getLatitude();	    if (lat2 < 84f) {		line = new OMLine(point1.getLatitude(), point1.getLongitude(),				  point2.getLatitude(), point2.getLongitude(),				  OMGraphic.LINETYPE_GREATCIRCLE);		line.setLinePaint(distanceGridPaint);  		list.add(line);	    }	}	if (doPolys) {	    for (i = 0; i < vertPoints.length; i++) {		if (UTM_DEBUG_VERBOSE) {		    for (int k = 0; k < vertPoints[i].length; k += 2) {			System.out.println(" for poly " + i + ": lat = " + 					   vertPoints[i][k] + ", lon = " +					   vertPoints[i][k+1]);		    }		}		poly = new OMPoly(vertPoints[i], OMGraphic.DECIMAL_DEGREES, 				  OMGraphic.LINETYPE_GREATCIRCLE);		poly.setLinePaint(distanceGridPaint);		list.add(poly);	    } 	} else {	    // This doesn't seem to calculate the right 	    // lines, although it looks like it should.	    if (UTM_DEBUG) {		Debug.output("Doing vertical lines");	    }	    utm1.northing = startNorthing;	    utm2.northing = endNorthing;	    // Vertical lines	    for (i = 1; i <= 9; i++) {		utm1.easting = i * 100000f;		utm2.easting = i * 100000f;		point1 = utm1.toLatLonPoint(Ellipsoid.WGS_84, point1);		point2 = utm2.toLatLonPoint(Ellipsoid.WGS_84, point2);		line = new OMLine(point1.getLatitude(), point1.getLongitude(),				  point2.getLatitude(), point2.getLongitude(),				  OMGraphic.LINETYPE_GREATCIRCLE);		line.setLinePaint(distanceGridPaint);		list.add(line);	    }	}	return list;    }