Re: [OpenMap Users] Several ways to close an OMPoly ?

From: Don Dietrick <dietrick_at_bbn.com>
Date: Wed, 13 Dec 2006 10:31:43 -0500

Hi Camille,

The easiest thing to do is when you are building your poly, test and
see if the first and last pairs of coordinates are the same, and if
not, add the first coordinate pair to the end of the set.

Telling the OMPoly/Editable OMPoly to treat the shape as a polygon
when the coordinates don't reflect a closed shape will only work when
the poly is being completely rendered (choosing a non-clear fill
color will also create a polygon). When you edit an OMPoly, only the
lines between the specified coordinates are rendered, so you end up
with that polyline effect.

- Don

On Dec 11, 2006, at 10:31 AM, Carsten Ø. Madsen wrote:

> Ok, extend the ompolyloader class to make the polys enclosed and
> use that loader to manage the polys
>
> public class MyPolyLoader extends OMPolyLoader {
>
> public MyPolyLoader() {
> }
>
> public EditableOMGraphic getEditableGraphic(String classname,
> GraphicAttributes ga) {
> EditableOMPoly result = (EditableOMPoly)
> super.getEditableGraphic(
> classname ga);
> if (result != null) {
> result.setEnclosed(true);
> }
> return result;
> }
>
> }
>
> maybe you will have to override more stuff...
>
>
> regards
> /carsten
>
> Camille Blondiaux wrote:
>> I tried, and it worked for the first display, but the poly reopens
>> as I click on it to edit and stays opened after editing if I do
>> not click the "link first to last node" button... strange... Kmouille
>>> Use setIsPolygon?
>> http://www.openmap.net/doc/api/com/bbn/openmap/omGraphics/
>> OMPoly.html#setIsPolygon(boolean)
>>> regards /carsten Camille Blondiaux wrote:
>>>> Hi ! I'm new to OpenMap, so my question may seem an easy one to
>>>> answer... An OMGraphicHandlerLayer of my soft is receiving from
>>>> a server a list of float llp = [x1, y1, x2, y2...] that is used
>>>> to draw an OMPoly on the screen. For the moment, I do omg = new
>>>> OMPoly(llp, OMGraphic.DECIMAL_DEGREES,
>>>> OMGraphic.LINETYPE_GREATCIRCLE); But my poly's not closed and
>>>> I'd like it to be ! So I can add the first point at the end of
>>>> the llp tab, but its behavior is bizarre when I add a point
>>>> (with the drawing tool) above the duplicated point ! Which other
>>>> way could I use to close the Poly ? I saw a geometryClosed
>>>> field, but how to modify it ? Or should I do by an
>>>> EditableOMPoly (which was no succesfull the way I tried) thanks
>>>> in advance Kmouille Accédez au courrier électronique de La Poste
>>>> sur www.laposte.net ou sur 3615 LAPOSTENET (0,34€ TTC /mn) 1
>>>> Giga de stockage gratuit - Antispam et antivirus intégrés -- [To
>>>> unsubscribe to this list send an email to
>> "majdart_at_bbn.com"
>>>> with the following text in the BODY of the message
>> "unsubscribe openmap-users"]
>> Accédez au courrier électronique de La Poste sur www.laposte.net
>> ou sur 3615 LAPOSTENET (0,34€ TTC /mn) 1 Giga de stockage gratuit
>> – Antispam et antivirus intégrés -- [To unsubscribe to this list
>> send an email to "majdart_at_bbn.com" with the following text in the
>> BODY of the message "unsubscribe openmap-users"]
>



=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, dietrick_at_bbn.com
BBN Technologies, Cambridge, MA
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Wed Dec 13 2006 - 10:36:18 EST

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:08 EDT