RE: [OpenMap Users] Threading

From: John McMahon <jmcmahon_at_mobilvox.com>
Date: Thu, 21 Jan 2010 14:47:52 -0500

The layers we are using are basic shapefiles and tiffs, nothing out of the
ordinary.

One thing that is rather important that I forgot to mention before is that
I'm running version 4.6.3. I am using this version because of the issue
with threads hanging on dispose() in the newer versions. We don't want to
have to call System.exit() in our application.

This is how I'm creating the projection:

        final ProjectionFactory projectionFactory =
ProjectionFactory.getInstance();
        projectionFactory.addProjectionLoader(new LLXYLoader());
        mapHandler.add(projectionFactory);
        final Projection projection = mapBean.getProjection();
        final LatLonPoint center = projection.getCenter();
        final Projection llxyProjection =
ProjectionFactory.makeProjection(LLXY.class,
                center.getLatitude(), center.getLongitude(),
projection.getScale(),
                projection.getWidth(), projection.getHeight());
        mapBean.setProjection(llxyProjection);

Yes the scale and location are what should be expected.

Thanks for your help,
John

-----Original Message-----
From: OpenMap Support [mailto:openmap_at_bbn.com]
Sent: Wednesday, January 20, 2010 9:06 PM
To: John McMahon
Cc: openmap-users_at_bbn.com
Subject: Re: [OpenMap Users] Threading

Given that the map will not be displayed to the user, I would continue to
pursue the ImageServer approach.

At this point, using the ImageServer, I would look at what the layers are
doing.

What kind of layers are you using?
If any of them are custom layers that you wrote, are they all
OMGraphicHandlerLayers, or extend from OMGraphicHandlerLayer? If the are,
are they launching any other threads in the prepare() method? If not, are
you extending the renderDataForProjection(...) method to get serialized
behavior?

How are you creating the Projection object for the image request? Are you
sure that the scale and location provided to the server are what you are
expecting (over data to be displayed)?


- Don

On Jan 20, 2010, at 5:23 PM, John McMahon wrote:

> Thanks, that seems to have helped a little bit, but it's not a consistent
> fix. Once in a while, it still displays an image with only some or no map
> layers being displayed.
>
> To answer your question, no part of the map should be displayed to the
user
> while generating this image.
>
> -----Original Message-----
> From: OpenMap Support [mailto:openmap_at_bbn.com]
> Sent: Wednesday, January 20, 2010 1:58 PM
> To: John McMahon
> Cc: openmap-users_at_bbn.com
> Subject: Re: [OpenMap Users] Threading
>
> Hi John,
>
> Is any part of OpenMap visible to the user, are the layers being used to
> display anything?
>
> If you don't have a map display, I would use the ImageServer object to
> create the images for you, it'll use the Layers' renderDataForProjection()
> methods which allows the layers to process the projection and render the
> OMGraphics for that projection in a serialized manner.
>
> Hope this helps,
> Don
>
>
>
> On Jan 20, 2010, at 1:21 PM, John McMahon wrote:
>
>> All,
>>
>> I'm trying to use OpenMap to generate reports that include images from
> maps drawn behind the scenes but not shown to the user. The problem seems
> to be a threading issue:
>>
>> Order things need to happen
>> 1. Layers need to load completely
>> 2. Image needs to be taken from map layers
>> 3. Report needs to be generated using map image
>>
>> Order things are actually happening because of threading
>> 1. Image taken of map layers
>> 2. Layers loading completely
>> 3. Report generated
>>
>> This results in a report that has a blank image ( or the image may only
> include some layers).
>>
>> Is there some way of getting a flag that tells us when the layers are
done
> loading/drawing?
>>
>> Thanks,
>> John
>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> 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"]
>
> --
> [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"]
--
[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 Thu Jan 21 2010 - 15:09:40 EST

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