本文整理汇总了Java中mil.nga.geopackage.tiles.features.FeatureTiles.getLinePaint方法的典型用法代码示例。如果您正苦于以下问题:Java FeatureTiles.getLinePaint方法的具体用法?Java FeatureTiles.getLinePaint怎么用?Java FeatureTiles.getLinePaint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mil.nga.geopackage.tiles.features.FeatureTiles
的用法示例。
在下文中一共展示了FeatureTiles.getLinePaint方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createFeatureTiles
import mil.nga.geopackage.tiles.features.FeatureTiles; //导入方法依赖的package包/类
/**
* Create a new feature tiles
*
* @return
*/
public static FeatureTiles createFeatureTiles(Context context, GeoPackage geoPackage, FeatureDao featureDao) {
FeatureTiles featureTiles = new DefaultFeatureTiles(context, featureDao);
Paint pointPaint = featureTiles.getPointPaint();
//pointPaint.setColor(Color.BLUE);
Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(), mil.nga.geopackage.test.R.drawable.ic_launcher);
bitmap = Bitmap.createScaledBitmap(bitmap, 25, 25, false);
FeatureTilePointIcon icon = new FeatureTilePointIcon(bitmap);
featureTiles.setPointIcon(icon);
Paint linePaint = featureTiles.getLinePaint();
linePaint.setColor(Color.GREEN);
Paint polygonPaint = featureTiles.getPolygonPaint();
polygonPaint.setColor(Color.RED);
featureTiles.setFillPolygon(true);
Paint polygonFillPaint = featureTiles.getPolygonFillPaint();
polygonFillPaint.setColor(Color.RED);
polygonFillPaint.setAlpha(50);
featureTiles.calculateDrawOverlap();
return featureTiles;
}
示例2: prepareFeatureDraw
import mil.nga.geopackage.tiles.features.FeatureTiles; //导入方法依赖的package包/类
/**
* Prepare the feature draw limits and defaults
*
* @param pointAlpha
* @param lineAlpha
* @param polygonAlpha
* @param polygonFillAlpha
* @param pointColor
* @param lineColor
* @param pointRadius
* @param lineStroke
* @param polygonColor
* @param polygonStroke
* @param polygonFill
* @param polygonFillColor
*/
private void prepareFeatureDraw(EditText pointAlpha, EditText lineAlpha, EditText polygonAlpha, EditText polygonFillAlpha,
Spinner pointColor, Spinner lineColor, EditText pointRadius, EditText lineStroke,
Spinner polygonColor, EditText polygonStroke, CheckBox polygonFill, Spinner polygonFillColor) {
// Set feature limits
pointAlpha.setFilters(new InputFilter[]{new InputFilterMinMax(
0, 255)});
lineAlpha.setFilters(new InputFilter[]{new InputFilterMinMax(
0, 255)});
polygonAlpha.setFilters(new InputFilter[]{new InputFilterMinMax(
0, 255)});
polygonFillAlpha.setFilters(new InputFilter[]{new InputFilterMinMax(
0, 255)});
// Set default feature attributes
FeatureTiles featureTiles = new DefaultFeatureTiles(getActivity());
String defaultColor = "black";
Paint pointPaint = featureTiles.getPointPaint();
pointColor.setSelection(((ArrayAdapter) pointColor.getAdapter()).getPosition(defaultColor));
pointAlpha.setText(String.valueOf(pointPaint.getAlpha()));
pointRadius.setText(String.valueOf(featureTiles.getPointRadius()));
Paint linePaint = featureTiles.getLinePaint();
lineColor.setSelection(((ArrayAdapter) lineColor.getAdapter()).getPosition(defaultColor));
lineAlpha.setText(String.valueOf(linePaint.getAlpha()));
lineStroke.setText(String.valueOf(linePaint.getStrokeWidth()));
Paint polygonPaint = featureTiles.getPolygonPaint();
polygonColor.setSelection(((ArrayAdapter) polygonColor.getAdapter()).getPosition(defaultColor));
polygonAlpha.setText(String.valueOf(polygonPaint.getAlpha()));
polygonStroke.setText(String.valueOf(polygonPaint.getStrokeWidth()));
polygonFill.setChecked(featureTiles.isFillPolygon());
Paint polygonFillPaint = featureTiles.getPolygonFillPaint();
polygonFillColor.setSelection(((ArrayAdapter) polygonFillColor.getAdapter()).getPosition(defaultColor));
polygonFillAlpha.setText(String.valueOf(polygonFillPaint.getAlpha()));
}
示例3: displayFeatureTiles
import mil.nga.geopackage.tiles.features.FeatureTiles; //导入方法依赖的package包/类
/**
* Display feature tiles
*
* @param featureOverlayTable
*/
private void displayFeatureTiles(GeoPackageFeatureOverlayTable featureOverlayTable) {
GeoPackage geoPackage = geoPackages.get(featureOverlayTable.getDatabase());
FeatureDao featureDao = featureDaos.get(featureOverlayTable.getDatabase()).get(featureOverlayTable.getFeatureTable());
BoundingBox boundingBox = new BoundingBox(featureOverlayTable.getMinLon(),
featureOverlayTable.getMinLat(), featureOverlayTable.getMaxLon(), featureOverlayTable.getMaxLat());
// Load tiles
FeatureTiles featureTiles = new DefaultFeatureTiles(getActivity(), featureDao);
featureTiles.setMaxFeaturesPerTile(featureOverlayTable.getMaxFeaturesPerTile());
if (featureOverlayTable.getMaxFeaturesPerTile() != null) {
featureTiles.setMaxFeaturesTileDraw(new NumberFeaturesTile(getActivity()));
}
FeatureIndexManager indexer = new FeatureIndexManager(getActivity(), geoPackage, featureDao);
featureTiles.setIndexManager(indexer);
Paint pointPaint = featureTiles.getPointPaint();
pointPaint.setColor(Color.parseColor(featureOverlayTable.getPointColor()));
pointPaint.setAlpha(featureOverlayTable.getPointAlpha());
featureTiles.setPointRadius(featureOverlayTable.getPointRadius());
Paint linePaint = featureTiles.getLinePaint();
linePaint.setColor(Color.parseColor(featureOverlayTable.getLineColor()));
linePaint.setAlpha(featureOverlayTable.getLineAlpha());
linePaint.setStrokeWidth(featureOverlayTable.getLineStrokeWidth());
Paint polygonPaint = featureTiles.getPolygonPaint();
polygonPaint.setColor(Color.parseColor(featureOverlayTable.getPolygonColor()));
polygonPaint.setAlpha(featureOverlayTable.getPolygonAlpha());
polygonPaint.setStrokeWidth(featureOverlayTable.getPolygonStrokeWidth());
featureTiles.setFillPolygon(featureOverlayTable.isPolygonFill());
if (featureTiles.isFillPolygon()) {
Paint polygonFillPaint = featureTiles.getPolygonFillPaint();
polygonFillPaint.setColor(Color.parseColor(featureOverlayTable.getPolygonFillColor()));
polygonFillPaint.setAlpha(featureOverlayTable.getPolygonFillAlpha());
}
featureTiles.calculateDrawOverlap();
FeatureOverlay overlay = new FeatureOverlay(featureTiles);
overlay.setBoundingBox(boundingBox, ProjectionFactory.getProjection(ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM));
overlay.setMinZoom(featureOverlayTable.getMinZoom());
overlay.setMaxZoom(featureOverlayTable.getMaxZoom());
FeatureTileTableLinker linker = new FeatureTileTableLinker(geoPackage);
List<TileDao> tileDaos = linker.getTileDaosForFeatureTable(featureDao.getTableName());
overlay.ignoreTileDaos(tileDaos);
GeometryColumns geometryColumns = featureDao.getGeometryColumns();
Contents contents = geometryColumns.getContents();
GeoPackageUtils.prepareFeatureTiles(featureTiles);
featureOverlayTiles = true;
FeatureOverlayQuery featureOverlayQuery = new FeatureOverlayQuery(getActivity(), overlay);
featureOverlayQueries.add(featureOverlayQuery);
displayTiles(overlay, contents.getBoundingBox(), contents.getSrs(), -1, boundingBox);
}