本文整理汇总了Java中org.gwtopenmaps.openlayers.client.Projection类的典型用法代码示例。如果您正苦于以下问题:Java Projection类的具体用法?Java Projection怎么用?Java Projection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Projection类属于org.gwtopenmaps.openlayers.client包,在下文中一共展示了Projection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTransformedFeatures
import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
private VectorFeature[] getTransformedFeatures(Vector vectorLayer, String epsg) {
List<VectorFeature> transformedFeatures = new ArrayList<VectorFeature>();
if (vectorLayer.getFeatures() != null) {
// logger.info("N. features de la Capa: " + layer.getFeatures().length);
for (VectorFeature feature : vectorLayer.getFeatures()) {
VectorFeature featureToExport = feature.clone();
featureToExport.getGeometry().transform(
new Projection(GeoMap.INTERNAL_EPSG),
new Projection(epsg));
transformedFeatures.add(featureToExport);
}
}
VectorFeature[] transArray = new VectorFeature[transformedFeatures
.size()];
return transformedFeatures.toArray(transArray);
}
示例2: initialize
import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
@PostConstruct
private void initialize() {
customExtentDialog.getAddToMapButton().addSelectHandler(
new SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
if (!isBBoxEmpty() && has4Coordinates()) {
Bounds bounds = getBounds();
Geometry geom = bounds.toGeometry();
geom.transform(new Projection("EPSG:4326"),
new Projection(geoMap.getMap()
.getProjection()));
VectorFeature vf = new VectorFeature(geom);
VectorLayer bboxLayer = VectorLayerFactory
.createEmptyVectorLayer(createBBoxLayerConfig());
bboxLayer.addFeature(vf);
layerManager.addVector(bboxLayer);
}
}
});
}
示例3: getTransformedFeatures
import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
private VectorFeature[] getTransformedFeatures() {
List<VectorFeature> transformedFeatures = new ArrayList<VectorFeature>();
if (layer.getFeatures() != null) {
logger.info("N. features de la Capa: " + layer.getFeatures().length);
for (VectorFeature feature : layer.getFeatures()) {
VectorFeature featureToExport = feature.clone();
featureToExport.getGeometry().transform(
new Projection(GeoMap.INTERNAL_EPSG),
new Projection("WGS84"));
transformedFeatures.add(featureToExport);
}
}
VectorFeature[] transArray = new VectorFeature[transformedFeatures
.size()];
return transformedFeatures.toArray(transArray);
}
示例4: createMapOption
import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
/**
* Creates the map option.
*
* @param isGoogle
* the is google
*/
private void createMapOption(boolean isGoogle)
{
// TODO Auto-generated method stub
OpenLayers.setProxyHost("gwtOpenLayersProxy?targetURL=");
this.defaultMapOptions = new MapOptions();
this.defaultMapOptions.setNumZoomLevels(18);
if (isGoogle)
{
this.defaultMapOptions.setProjection("EPSG:900913");
this.defaultMapOptions.setDisplayProjection(new Projection("EPSG:4326"));
this.defaultMapOptions.setUnits(MapUnits.METERS);
this.defaultMapOptions.setMaxExtent(new Bounds(-20037508, -20037508, 20037508,
20037508.34));
this.defaultMapOptions.setMaxResolution(new Double(156543.0339).floatValue());
}
else
{
this.defaultMapOptions.setProjection("EPSG:4326");
}
initMapWidget(this.defaultMapOptions, isGoogle);
}
示例5: configure
import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
public void configure(final Projection displayProjection, final Integer numZoomLevels, final String units) {
this.displayProjection = displayProjection;
mapOptions = new MapOptions();
mapOptions.setDisplayProjection(this.displayProjection);
mapOptions.setNumZoomLevels(numZoomLevels);
mapOptions.setUnits(units);
mapOptions.setMaxExtent(getDefaultMapBound());
mapOptions.setMaxResolution(appClientProperties.getFloatValue("maxResolution"));
getMap().setOptions(mapOptions);
getMap().setMinMaxZoomLevel(0, 20);
}
示例6: generateBbox
import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
public void generateBbox() {
queryBbox = true;
GeoMap geoMap = IOC.getBeanManager().lookupBean(GeoMap.class)
.getInstance();
if (GeoMap.INTERNAL_EPSG.equals(getEpsg())) {
this.bbox = geoMap.getMap().getExtent();
} else {
this.bbox = geoMap.getMap().getExtent()
.transform(new Projection(GeoMap.INTERNAL_EPSG),
new Projection(getEpsg()));
}
}
示例7: calculatePolygonLenght
import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
private double calculatePolygonLenght(Polygon polygon) {
double lenght = 0;
for (LinearRing ring : polygon.getComponents()) {
lenght = lenght
+ ring.getGeodesicLength(new Projection(
GeoMap.INTERNAL_EPSG));
}
return lenght;
}
示例8: getWKTToWGS84
import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
private String getWKTToWGS84(Bounds bounds) {
Geometry geom = bounds.toGeometry().clone();
geom.transform(new Projection(geoMap.getMap().getProjection()), new Projection("EPSG:4326"));
VectorFeature extentFeature = new VectorFeature(geom);
WKT wktFormat = new WKT();
return wktFormat.write(extentFeature);
}
示例9: getTransformedFeatures
import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
public VectorFeature[] getTransformedFeatures(Vector layer, String epsg) {
List<VectorFeature> transformedFeatures = new ArrayList<VectorFeature>();
if (layer.getFeatures() != null) {
for (VectorFeature feature : layer.getFeatures()) {
VectorFeature featureToExport = feature.clone();
featureToExport.getGeometry().transform(
new Projection(geoMap.getMap().getProjection()),
new Projection(epsg));
transformedFeatures.add(featureToExport);
}
}
VectorFeature[] transArray = new VectorFeature[transformedFeatures
.size()];
return transformedFeatures.toArray(transArray);
}
示例10: configure
import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
public void configure(final Projection displayProjection, final Integer numZoomLevels, final String units) {
this.displayProjection = displayProjection;
mapOptions = new MapOptions();
mapOptions.setDisplayProjection(this.displayProjection);
mapOptions.setNumZoomLevels(numZoomLevels);
mapOptions.setUnits(units);
mapOptions.setMaxExtent(getDefaultMapBound());
mapOptions.setMaxResolution(appClientProperties.getFloatValue("maxResolution"));
getMap().setOptions(mapOptions);
getMap().setMinMaxZoomLevel(0, 50);
}
示例11: zoomToBounds
import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
/** Zooms to a specified bounding box.
*
* @param bounds
*/
public void zoomToBounds(Bounds bounds) {
if(bounds == null){
return;
}
bounds = bounds.transform( new Projection("EPSG: 900913"), new Projection("EPSG: 4326"));
this.map.zoomToExtent(bounds);
}
示例12: printContacts
import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
/**
* Prints the given {@link ReducedContact}s on this MapWidget.
*
* @param contacts
* - a list of {@link ReducedContact} objects resulting from search
*/
public void printContacts(List<? extends ReducedContact> contacts) {
getVectorLayer().destroyFeatures();
Style pointStyle = new Style();
for (ReducedContact c : contacts) {
Point point = new Point(c.getLongitude(), c.getLatitude());
point.transform(proj, new Projection(map.getProjection()));
pointStyle.setExternalGraphic("img/map_marker_red.png");
pointStyle.setGraphicSize(10, 17);
pointStyle.setFillOpacity(1.0);
VectorFeature pointFeature = new VectorFeature(point, pointStyle);
pointFeature.getAttributes().setAttribute(Const.FEATURE_ATTRIBUTE_CONTACT_ID, c.getId());
pointFeature.setFeatureId(c.getId());
getVectorLayer().addFeature(pointFeature);
}
Bounds dataExtent = getVectorLayer().getDataExtent();
boolean outOfBounds = !maxVisibleExtent.containsBounds(dataExtent, false, true);
if(!outOfBounds){
zoomToBounds(getVectorLayer().getDataExtent());
}else{
this.setCenter(new LonLat(8, 48), 5);
}
}
示例13: PlotPointDiary
import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
public void PlotPointDiary(Boolean plot) {
map.addLayer(diaryVectorLayer);
Style pointStyle = new Style();
if (plot == true) {
System.out.println(MaryList.getSize());
for (int i=0; i<MaryList.getSize(); i++) {
ReducedContact c = MaryList.getReducedContact(i);
Point point = new Point(c.getLongitude(), c.getLatitude());
point.transform(proj, new Projection(map.getProjection()));
pointStyle.setExternalGraphic("img/map_marker_red.png");
pointStyle.setGraphicSize(10, 17);
pointStyle.setFillOpacity(1.0);
VectorFeature pointFeature = new VectorFeature(point, pointStyle);
pointFeature.getAttributes().setAttribute(Const.FEATURE_ATTRIBUTE_CONTACT_ID, c.getId());
pointFeature.setFeatureId(c.getId());
diaryVectorLayer.addFeature(pointFeature);
}
ruskinControl.deactivate();
allControl.deactivate();
diaryControl.activate();
}
else {
eraseDiaryContacts();
diaryControl.deactivate();
map.removeLayer(diaryVectorLayer);
}
}
示例14: PlotPointsRuskin
import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
public void PlotPointsRuskin (Boolean plot) {
Style pointStyle = new Style();
map.addLayer(ruskinVectorLayer);
if (plot == true) {
ReducedContact c = new ReducedContact("John Was Here", 60, 40);
LonLat ll = c.getCoordinate();
Point point = new Point(ll.lon(), ll.lat());
point.transform(proj, new Projection(map.getProjection()));
pointStyle.setExternalGraphic("img/map_marker_blue.png");
pointStyle.setGraphicSize(10, 17);
pointStyle.setFillOpacity(1.0);
VectorFeature pointFeature = new VectorFeature(point, pointStyle);
pointFeature.getAttributes().setAttribute(Const.FEATURE_ATTRIBUTE_CONTACT_ID, c.getId());
pointFeature.setFeatureId(c.getId());
ruskinVectorLayer.addFeature(pointFeature);
allControl.deactivate();
diaryControl.deactivate();
ruskinControl.activate();
}
else {
eraseRuskinContacts();
ruskinControl.deactivate();
map.removeLayer(ruskinVectorLayer);
}
}
示例15: drawAoiOnMap
import org.gwtopenmaps.openlayers.client.Projection; //导入依赖的package包/类
/**
* Draw aoi on map.
*
* @param wkt
* the wkt
*/
public void drawAoiOnMap(String wkt)
{
this.eraseFeatures();
MultiPolygon geom = MultiPolygon.narrowToMultiPolygon(Geometry.fromWKT(wkt).getJSObject());
geom.transform(new Projection("EPSG:4326"), new Projection("EPSG:900913"));
VectorFeature vectorFeature = new VectorFeature(geom);
this.vector.addFeature(vectorFeature);
this.map.zoomToExtent(geom.getBounds());
}