Re: [OpenMap Users] ServerMapTileFactory and UI responsiveness

From: Gary Briggs <chunky_at_icculus.org>
Date: Sun, 14 Apr 2013 19:05:33 -0400

On Tue, Apr 09, 2013 at 01:43:58PM -0400, Don Dietrick wrote:
> Hi Gary,
>
> I'll have to look into this. The layer fetches the tiles in a separate thread, so the GUI shouldn't block. What OS and jdk version are you using?

Don,

Thanks for replying; I've been trying to build a minimal case, but
of course, then my blocking issue doesn't manifest.

Now I'm looking to see if the problem is the EsriPlugin I'm using instead
of the ServerMapTileFactory. I'll send it to the list as soon as I have a
minimal case.

As an aside: Is there a concrete guideline as to when to use EsriPlugin
vs ShapeFile vs EsriLayer, when I have on-disk shapefiles?

Thanks,
Gary

> - Don
>
> On Apr 8, 2013, at 9:32 PM, Gary Briggs wrote:
>
> > Afternoon,
> >
> > I'm using openmap in a project where users can click on zip codes and
> > an openmap window scrolls to those zip codes and highlights them.
> >
> > That's working great, and is very speedy. The problem I'm suffering is
> > that as soon as I include a ServerMapTileFactory, UI responsiveness and
> > performance plummets; it's as if the network queries are being done
> > on the same thread as the rest of the Swing event queue, causing it to
> > block for as long as it takes to download a tile.
> >
> > This demonstrates the issue:
> >
> > OverlayMapPanel omp = new OverlayMapPanel();
> > MapHandler mapHandler = omp.getMapHandler();
> > ServerMapTileFactory serverMapTileFactory =
> > new ServerMapTileFactory("http://otile1.mqcdn.com/tiles/1.0.0/map/");
> > // From http://developer.mapquest.com/web/products/open/map
> > MapTileLayer mapTileLayer = new MapTileLayer(serverMapTileFactory);
> > mapHandler.add(mapTileLayer);
> >
> > Dragging it around at various zoom levels soon begins to lag the rest
> > of the UI, and any code in the rest of the UI that makes the map move
> > a long way causes the rest of the UI to become unresponsive.
> >
> > For example, I have code that creates a new EsriPlugIn, then calls
> > openMapPanel.getMapBean().setCenter(esriplugin.getDataBounds().getCenter());
> > This essentially locks the UI until all the tiles have been loaded,
> > which sometimes takes a while.
> >
> >
> > So, the question; is there a way to get the maps download
> > asynchronously? Or am I doing something totally wrong here?
> >
> > Thank-you!
> > Gary
> >
> > --
> > [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"]

--
[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 Sun Apr 14 2013 - 19:07:51 EDT

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