private Coordinate convertToLatLon(Coordinate coordinate) { double lat = (coordinate.getY() / MERCATOR_WIDTH) * HALF_CIRCLE; double lon = (coordinate.getX() / MERCATOR_WIDTH) * HALF_CIRCLE; lat = HALF_CIRCLE / Math.PI * (2 * Math.atan(Math.exp(lat * Math.PI / HALF_CIRCLE)) - Math.PI / 2.0); return new Coordinate(lat, lon); }
private void addShapeToGraphicsContext( GraphicsContext graphics, Object parentGroup, String identifier, Coordinate coordinate, ShapeStyle style) { int vertexSize = getStyleService().getPointSymbolizerShapeAndSize().getSize(); int halfVertexSize = vertexSize / 2; switch (styleService.getPointSymbolizerShapeAndSize().getShape()) { case SQUARE: Bbox rectangle = new Bbox( coordinate.getX() - halfVertexSize, coordinate.getY() - halfVertexSize, vertexSize, vertexSize); graphics.drawRectangle(parentGroup, identifier, rectangle, style); break; case CIRCLE: graphics.drawCircle(parentGroup, identifier, coordinate, vertexSize, style); break; } }
private Bbox convertToLatLon(Bbox bounds) { // convert corners Coordinate orig = convertToLatLon(bounds.getOrigin()); Coordinate end = convertToLatLon(bounds.getEndPoint()); return new Bbox(orig.getX(), orig.getY(), end.getX() - orig.getX(), end.getY() - orig.getY()); }
private void fitGoogleMapBounds(JavaScriptObject object, Coordinate center, int zoomLevel) { doFitGoogleMapBounds(object, center.getX(), center.getY(), zoomLevel); }