Re: [OpenMap Users] ServerMapTileFactory and UI responsiveness

From: Gary Briggs <chunky_at_icculus.org>
Date: Fri, 16 Aug 2013 14:39:39 -0400

Hey Don, I know this was a while ago; I've recently been messing with
this again, and I think that I've got an easy way to show the problem.
[I'm using the default openmap-5.0.1.jar that comes in the download. As
an aside, that appears to have been compiled with JDK7 as a minimum
requirement, where before it was JDK5; did something change to make Java
7 a requirement? I still have to support a lot of people on java6]

Anyways. For the issue: Take the default openmap.properties at the top-level of the openmap-5.0.1 download, and add this:

# Map Tile Layer, using OpenStreetMap tiles
tilesosm.class=com.bbn.openmap.layer.imageTile.MapTileLayer
tilesosm.prettyName=OpenStreetMap
tilesosm.cacheSize=6000
tilesosm.tileFactory=com.bbn.openmap.dataAccess.mapTile.ServerMapTileFactory
tilesosm.rootDir=http://a.tile.openstreetmap.org/
tilesosm.localCacheRootDir=cache/OSM

Now add "tilesosm" to the openmap.layers variable, but *not* to
openmap.startUpLayers.

So, open openmap [I use:
java -jar openmap.jar -properties openmap.properties
]
Now go to the "layers" drop-down and click to enable OSM. The whole GUI
locks while it does the first set of tile downloads. After that all is
well. Note that there's a cache dir in that config, so on a subsequaent
start, if you leave that cache intact, the GUI locks for a much shorter
time, and if you delete the cache dir then it goes back to locking while
doing the download.

I hope that was clear enough. If not, please let me know.

Thank-you very much,
Gary

PS Openmap is fantastic. I've been using it extensively recently. If
I could make one other suggestion... it would have helped me a lot
with the initial discovery process if there had been a configured
servermaptilefactory [as the one above], and if one of the things in
openmap.addablelayers had been a
com.bbn.openmap.layer.location.csv.CSVLocationHandler
Both of those are things I use more than anything else at this moment

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
>
> 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 Fri Aug 16 2013 - 14:40:43 EDT

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