Issue #2361 speed up map initialization by moving field queries off UI
thread Change-Id: Ia7d72842723435cc93fe22a1d3266b80dcfe5ab5 Former-commit-id:cc2998b487
[formerlyd4b6ad1eee
[formerly 75c1037145b0aec9cd5e0c0707f0904f4b703bc3]] Former-commit-id:d4b6ad1eee
Former-commit-id:a52e7b677f
This commit is contained in:
parent
5892894c4c
commit
f1c965dde8
1 changed files with 13 additions and 8 deletions
|
@ -92,6 +92,8 @@ import com.vividsolutions.jts.io.WKBReader;
|
|||
* Sep 18, 2012 1019 randerso improved error handling
|
||||
* Aug 12, 2013 1133 bsteffen Better error handling for invalid
|
||||
* polygons in map resource.
|
||||
* Nov 06, 2013 2361 njensen Prepopulate fields in initInternal
|
||||
* instead of constructor for speed
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -295,9 +297,10 @@ public class DbMapResource extends
|
|||
fields.add(column.toString());
|
||||
}
|
||||
}
|
||||
double[] lev = getLevels();
|
||||
QueryResult mappedResult = DbMapQueryFactory.getMapQuery(
|
||||
resourceData.getTable(),
|
||||
getGeomField(levels[levels.length - 1]))
|
||||
getGeomField(lev[lev.length - 1]))
|
||||
.queryWithinEnvelope(req.envelope, fields,
|
||||
constraints);
|
||||
Map<Integer, Geometry> gidMap = new HashMap<Integer, Geometry>(
|
||||
|
@ -533,7 +536,7 @@ public class DbMapResource extends
|
|||
|
||||
protected Map<Object, RGB> colorMap;
|
||||
|
||||
protected double[] levels;
|
||||
private double[] levels;
|
||||
|
||||
protected double lastSimpLev;
|
||||
|
||||
|
@ -543,16 +546,11 @@ public class DbMapResource extends
|
|||
|
||||
private MapQueryJob queryJob;
|
||||
|
||||
protected String geometryType;
|
||||
private String geometryType;
|
||||
|
||||
public DbMapResource(DbMapResourceData data, LoadProperties loadProperties) {
|
||||
super(data, loadProperties);
|
||||
queryJob = new MapQueryJob();
|
||||
|
||||
// Prepopulate fields
|
||||
getGeometryType();
|
||||
getLabelFields();
|
||||
getLevels();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -571,6 +569,13 @@ public class DbMapResource extends
|
|||
@Override
|
||||
protected void initInternal(IGraphicsTarget target) throws VizException {
|
||||
super.initInternal(target);
|
||||
|
||||
// Prepopulate fields in initInternal since this is not on the UI
|
||||
// thread
|
||||
getGeometryType();
|
||||
getLabelFields();
|
||||
getLevels();
|
||||
|
||||
getCapability(ShadeableCapability.class).setAvailableShadingFields(
|
||||
getLabelFields().toArray(new String[0]));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue