Hi Juan,
Are you experiencing the problem for any other layer as well, or does
it only show up when a layer draws these ellipses?
Also, I don't think the ellipse you are drawing is doing what you think
it is doing. The ellipse is not a distance ellipse on the ground. The
four points at the major and minor axis are located at the right point,
but the other points are being rendering in x/y space. There was a
thread recently on the openmap-users mailing list describing the
algorithm for creating a lat/lon ellipse, and there will be an
OMEllipse in the next version of OpenMap.
- Don
On Thursday, September 11, 2003, at 10:23 AM, Velasquez, Juan J. wrote:
> Hello everyone,
>
> I need help in finding a solution to a problem that I have.
>
> The problem is the following:
>
> My application is drawing elipses according to lat, lon received
> thru X-Windows from another X-window application. When I am running my
> application on the same computer, I can draw many elipses without much
> of a
> delay, but when I am receiving it from other computer to draw in
> openmap.
> Openmap is taking to long to draw the elipses on the layer. I would
> like to
> know if someone has this problem before and how they found a solution
> to it.
>
> Thank you
> Juan Velasquez
>
> P.S. Below is an example function from one my classes that used the
> adding
> and drawing of the elipses on an openmap layer.
>
> ......
>
> public void addEllipse(float lat, float lon, double majr, double minr,
> double tilt) {
> int w, h;
> int pos;
> double scale = (double)currentProjection.getScale();
> //System.out.println("The scale for the map is " + scale);
>
> /**
> * Save the ellipse major and minor axis.
> */
> if (ellipseList == null) {
> pos = 0;
> } else {
> pos = ellipseList.size();
> }
> ellipseHeightNm[pos] = majr;
> ellipseWidthNm[pos] = minr;
> ellipseTilt[pos] = tilt;
> ellipseLat[pos] = lat;
> ellipseLon[pos] = lon;
>
> /**
> * Calculate ellipse pixel width and height in Nautical Miles.
> * Major and Minor axis units are in Nautical Miles.
> * Scale is a ratio of pixels.
> */
> h = (int)(majr * METERS_PER_NAUTICAL_MILE * PIXELS_PER_METER /
> scale);
> w = (int)(minr * METERS_PER_NAUTICAL_MILE * PIXELS_PER_METER /
> scale);
>
> /*
> System.out.println("The height is " + majr + " nm.");
> System.out.println("The width is " + minr + " nm.");
> System.out.println("The tilt is " + tilt + " deg.");
>
> System.out.println("The pixel height is " + h + " pixels.");
> System.out.println("The pixel width is " + w + " pixels.");
> */
>
> OMCircle newEllipse = new OMCircle(lat, lon, w, h);
> newEllipse.setRotationAngle(tilt);
> newEllipse.setLinePaint(ellipseColor);
> newEllipse.setFillPaint(ellipseFillColor);
> ellipseList.addOMGraphic(newEllipse);
> }
>
> ..................
> --
> [To unsubscribe to this list send an email to "majdart@bbn.com"
> with the following text in the BODY of the message "unsubscribe
> openmap-users"]
>
>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, BBN Technologies, dietrick@bbn.com
10 Moulton Street, Cambridge, MA 02138
617-873-3031 [fax]-2794
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-- [To unsubscribe to this list send an email to "majdart@bbn.com" with the following text in the BODY of the message "unsubscribe openmap-users"]Received on Tue Sep 23 10:04:43 2003
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:36 EDT