当前位置: 首页>>代码示例>>Java>>正文


Java ExceptionCode.TRANSFORMER_CREATE_LAYER_TO_MAP_FAILED属性代码示例

本文整理汇总了Java中org.geomajas.global.ExceptionCode.TRANSFORMER_CREATE_LAYER_TO_MAP_FAILED属性的典型用法代码示例。如果您正苦于以下问题:Java ExceptionCode.TRANSFORMER_CREATE_LAYER_TO_MAP_FAILED属性的具体用法?Java ExceptionCode.TRANSFORMER_CREATE_LAYER_TO_MAP_FAILED怎么用?Java ExceptionCode.TRANSFORMER_CREATE_LAYER_TO_MAP_FAILED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.geomajas.global.ExceptionCode的用法示例。


在下文中一共展示了ExceptionCode.TRANSFORMER_CREATE_LAYER_TO_MAP_FAILED属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getUnitLength

private double getUnitLength(String mapCrsKey, Bbox mapBounds) throws LayerException {
	try {
		if (null == mapBounds) {
			throw new LayerException(ExceptionCode.MAP_MAX_EXTENT_MISSING);
		}
		Crs crs = geoService.getCrs2(mapCrsKey);
		GeodeticCalculator calculator = new GeodeticCalculator(crs);
		Coordinate center = new Coordinate(0.5 * (mapBounds.getX() + mapBounds.getMaxX()),
				0.5 * (mapBounds.getY() + mapBounds.getMaxY()));
		calculator.setStartingPosition(new DirectPosition2D(crs, center.getX(), center.getY()));
		calculator.setDestinationPosition(new DirectPosition2D(crs, center.getX() + 1, center.getY()));
		return calculator.getOrthodromicDistance();
	} catch (TransformException e) {
		throw new LayerException(e, ExceptionCode.TRANSFORMER_CREATE_LAYER_TO_MAP_FAILED);
	}
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:16,代码来源:ConfigurationDtoPostProcessor.java

示例2: getClientMaxExtent

public Bbox getClientMaxExtent(String mapCrsKey, String layerCrsKey, Bbox serverBbox, String layer)
		throws LayerException {
	if (mapCrsKey.equals(layerCrsKey)) {
		return serverBbox;
	}
	try {
		Crs mapCrs = geoService.getCrs2(mapCrsKey);
		Crs layerCrs = geoService.getCrs2(layerCrsKey);
		Envelope serverEnvelope = converterService.toInternal(serverBbox);
		CrsTransform transformer = geoService.getCrsTransform(layerCrs, mapCrs);
		Bbox res = converterService.toDto(geoService.transform(serverEnvelope, transformer));
		if (Double.isNaN(res.getX()) || Double.isNaN(res.getY()) || Double.isNaN(res.getWidth())
				|| Double.isNaN(res.getHeight())) {
			throw new LayerException(ExceptionCode.LAYER_EXTENT_CANNOT_CONVERT, layer, mapCrsKey);
		}
		return res;
	} catch (GeomajasException e) {
		throw new LayerException(e, ExceptionCode.TRANSFORMER_CREATE_LAYER_TO_MAP_FAILED);
	}
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:20,代码来源:ConfigurationDtoPostProcessor.java


注:本文中的org.geomajas.global.ExceptionCode.TRANSFORMER_CREATE_LAYER_TO_MAP_FAILED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。