[OpenMap Users] ServerMapTileFactory and UI responsiveness

From: Gary Briggs <chunky_at_icculus.org>
Date: Mon, 8 Apr 2013 21:32:05 -0400

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"]
Received on Mon Apr 08 2013 - 21:34:11 EDT

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