public Point[][] getCoordinatesAbsolute() { // deferred evaluation as some PolyLineContainers will never be drawn. However, // to save memory, after computing the absolute coordinates, the way is released. if (coordinatesAbsolute == null) { coordinatesAbsolute = new Point[way.latLongs.length][]; for (int i = 0; i < way.latLongs.length; ++i) { coordinatesAbsolute[i] = new Point[way.latLongs[i].length]; for (int j = 0; j < way.latLongs[i].length; ++j) { coordinatesAbsolute[i][j] = MercatorProjection.getPixelAbsolute(way.latLongs[i][j], upperLeft.mapSize); } } this.way = null; } return coordinatesAbsolute; }
public PolylineContainer(Way way, Tile upperLeft, Tile lowerRight) { this.coordinatesAbsolute = null; this.coordinatesRelativeToTile = null; this.tags = way.tags; this.upperLeft = upperLeft; this.lowerRight = lowerRight; this.layer = way.layer; this.way = way; this.isClosedWay = LatLongUtils.isClosedWay(way.latLongs[0]); if (this.way.labelPosition != null) { this.center = MercatorProjection.getPixelAbsolute(this.way.labelPosition, this.upperLeft.mapSize); } }
@Override public void renderPointOfInterestSymbol(final RenderContext renderContext, Display display, int priority, Bitmap symbol, PointOfInterest poi) { if (renderLabels) { Point poiPosition = MercatorProjection.getPixelAbsolute(poi.position, renderContext.rendererJob.tile.mapSize); renderContext.labels.add(new SymbolContainer(poiPosition, display, priority, symbol)); } }
@Override public void renderPointOfInterestCaption(final RenderContext renderContext, Display display, int priority, String caption, float horizontalOffset, float verticalOffset, Paint fill, Paint stroke, Position position, int maxTextWidth, PointOfInterest poi) { if (renderLabels) { Point poiPosition = MercatorProjection.getPixelAbsolute(poi.position, renderContext.rendererJob.tile.mapSize); renderContext.labels.add(this.graphicFactory.createPointTextContainer(poiPosition.offset(horizontalOffset, verticalOffset), display, priority, caption, fill, stroke, null, position, maxTextWidth)); } }
public Point[][] getCoordinatesAbsolute() { // deferred evaluation as some PolyLineContainers will never be drawn. However, // to save memory, after computing the absolute coordinates, the way is released. if (coordinatesAbsolute == null) { coordinatesAbsolute = new Point[way.latLongs.length][]; for (int i = 0; i < way.latLongs.length; ++i) { coordinatesAbsolute[i] = new Point[way.latLongs[i].length]; for (int j = 0; j < way.latLongs[i].length; ++j) { coordinatesAbsolute[i][j] = MercatorProjection.getPixelAbsolute(way.latLongs[i][j], upperLeft.mapSize); } } this.way = null; } return coordinatesAbsolute; }
@Override public void renderPointOfInterestSymbol(final RenderContext renderContext, Display display, int priority, Bitmap symbol, PointOfInterest poi) { if (renderLabels) { Point poiPosition = MercatorProjection.getPixelAbsolute(poi.position, renderContext.rendererJob.tile.mapSize); renderContext.labels.add(new SymbolContainer(poiPosition, display, priority, symbol)); } }
public PolylineContainer(Way way, Tile upperLeft, Tile lowerRight) { this.coordinatesAbsolute = null; this.coordinatesRelativeToTile = null; this.tags = way.tags; this.upperLeft = upperLeft; this.lowerRight = lowerRight; this.layer = way.layer; this.way = way; this.isClosedWay = LatLongUtils.isClosedWay(way.latLongs[0]); if (this.way.labelPosition != null) { this.center = MercatorProjection.getPixelAbsolute(this.way.labelPosition, this.upperLeft.mapSize); } }
@Override public void renderPointOfInterestCaption(final RenderContext renderContext, Display display, int priority, String caption, float horizontalOffset, float verticalOffset, Paint fill, Paint stroke, Position position, int maxTextWidth, PointOfInterest poi) { if (renderLabels) { Point poiPosition = MercatorProjection.getPixelAbsolute(poi.position, renderContext.rendererJob.tile.mapSize); renderContext.labels.add(this.graphicFactory.createPointTextContainer(poiPosition.offset(horizontalOffset, verticalOffset), display, priority, caption, fill, stroke, null, position, maxTextWidth)); } }