本文整理汇总了Java中org.gwtopenmaps.openlayers.client.LonLat.transform方法的典型用法代码示例。如果您正苦于以下问题:Java LonLat.transform方法的具体用法?Java LonLat.transform怎么用?Java LonLat.transform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.gwtopenmaps.openlayers.client.LonLat
的用法示例。
在下文中一共展示了LonLat.transform方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMouseMoverEventHandler
import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
private EventHandler getMouseMoverEventHandler() {
return new EventHandler() {
@Override
public void onHandle(final EventObject eventObject) {
final LonLat lonlat = getLonLat(eventObject);
if (!GeoMap.INTERNAL_EPSG.equals(geoMap.getDisplayProjection()
.getProjectionCode())) {
lonlat.transform(GeoMap.INTERNAL_EPSG, geoMap
.getDisplayProjection().getProjectionCode());
}
final Double scale = Double.valueOf((geoMap.getMap().getScale()));
statusPanelWidget.setScale("1:" + scale.intValue());
statusPanelWidget.setCurrentCoordinate(lonlat);
}
};
}
示例2: getMouseClickEventHandler
import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
private EventHandler getMouseClickEventHandler() {
return new EventHandler() {
@Override
public void onHandle(final EventObject eventObject) {
final LonLat lonlat = getLonLat(eventObject);
if (!GeoMap.INTERNAL_EPSG.equals(geoMap.getDisplayProjection()
.getProjectionCode())) {
lonlat.transform(GeoMap.INTERNAL_EPSG, geoMap
.getDisplayProjection().getProjectionCode());
}
statusPanelWidget.setClickedCoordinates(lonlat.lon(),
lonlat.lat());
if (w3wTool.isActive()) {
showW3WPosition(eventObject);
}
}
};
}
示例3: init
import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
@Override
protected void init() {
mapWidget = new MapWidget("100%", "100%", new MapOptions());
// Humanitarian layer
final OSMOptions hotOption = new OSMOptions();
hotOption.setIsBaseLayer(true);
hotOption.crossOriginFix();
hotOption.setSphericalMercator(true);
XYZ HOTLayer = new XYZ(I18N.CONSTANTS.humanitarianOSMLayer(), "http://a.tile.openstreetmap.fr/hot/${z}/${x}/${y}.png", hotOption);
// Basic layer
OSM osmMapnik = new OSM();
osmMapnik.setName(I18N.CONSTANTS.basicOSMLayer());
osmMapnik.setIsBaseLayer(true);
// Pin layer
vectorLayer = new Vector(I18N.CONSTANTS.projectSitesLayer());
// Drag & drop listeners
dragFeature = createDraggableFeature(vectorLayer);
// Center & zoom
LonLat lonLat = new LonLat(0, 0);
lonLat.transform(TRANSFORM_SOURCE, mapWidget.getMap().getProjection());
mapWidget.getMap().addLayer(HOTLayer);
mapWidget.getMap().addLayer(osmMapnik);
mapWidget.getMap().addLayer(vectorLayer);
mapWidget.getMap().addControl(new LayerSwitcher());
mapWidget.getMap().setCenter(lonLat, 1);
mapWidget.getMap().updateSize();
getRoot().add(mapWidget);
setInitialized(true);
}
示例4: displayBounds
import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
@Override
protected void displayBounds(BoundingBoxDTO bounds) {
final LonLat lower = new LonLat(bounds.getX1(), bounds.getY1());
lower.transform(TRANSFORM_SOURCE, mapWidget.getMap().getProjection());
final LonLat upper = new LonLat(bounds.getX2(), bounds.getY2());
upper.transform(TRANSFORM_SOURCE, mapWidget.getMap().getProjection());
final Bounds b = new Bounds(lower.lon(), lower.lat(), upper.lon(), upper.lat());
mapWidget.getMap().setCenter(b.getCenterLonLat(),
mapWidget.getMap().getZoomForExtent(b, false));
mapWidget.getMap().updateSize();
}
示例5: displayCenterAndZoom
import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
@Override
protected void displayCenterAndZoom(double latitude, double longitude, int zoom) {
final LonLat lonLat = new LonLat(longitude, latitude);
lonLat.transform(TRANSFORM_SOURCE, mapWidget.getMap().getProjection());
mapWidget.getMap().setCenter(lonLat, zoom);
}
示例6: createNativePin
import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
@Override
protected VectorFeature createNativePin(Pin pin) {
final Style style = new Style();
if(pin.getTitle() != null) {
style.setLabel(pin.getTitle());
}
if(pin.getImageURL() != null) {
style.setExternalGraphic(pin.getImageURL());
style.setGraphicSize(pin.getImageWidth(), pin.getImageHeight());
style.setGraphicOffset(
// Horizontal center
-pin.getImageWidth() / 2,
// Bottom
-pin.getImageHeight());
} else {
style.setExternalGraphic("http://www.google.com/mapfiles/marker.png");
style.setGraphicSize(20, 34);
style.setGraphicOffset(-10, -34);
}
style.setFillOpacity(1.0);
if(pin.isDraggable() && !draggable) {
draggable = true;
mapWidget.getMap().addControl(dragFeature);
dragFeature.activate();
}
final LonLat lonLat = new LonLat(pin.getLongitude(), pin.getLatitude());
lonLat.transform(TRANSFORM_SOURCE, mapWidget.getMap().getProjection());
final Point point = new Point(lonLat.lon(), lonLat.lat());
final VectorFeature vectorFeature = new VectorFeature(point, style);
vectorFeature.setFeatureId("P" + (++featureIdSequence));
return vectorFeature;
}
示例7: movePin
import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
@Override
protected void movePin(VectorFeature pin, double latitude, double longitude) {
final LonLat lonLat = new LonLat(longitude, latitude);
lonLat.transform(TRANSFORM_SOURCE, mapWidget.getMap().getProjection());
pin.move(lonLat);
}
示例8: panTo
import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
@Override
public void panTo(double latitude, double longitude) {
final LonLat lonLat = new LonLat(longitude, latitude);
lonLat.transform(TRANSFORM_SOURCE, mapWidget.getMap().getProjection());
mapWidget.getMap().setCenter(lonLat);
}
示例9: centerMap
import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
public void centerMap(final double lon, final double lat, final String sourceProjection, final String targetProjection){
final LonLat lonLat = new LonLat(lon, lat);
lonLat.transform(sourceProjection, targetProjection);
getMap().setCenter(lonLat, 5);
}
示例10: transformToWGS84
import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
private LonLat transformToWGS84(final LonLat lonLat) {
lonLat.transform(geoMap.getMap().getProjection(), "EPSG:4326");
return lonLat;
}
示例11: transformToInternalProjection
import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
private void transformToInternalProjection(final LonLat lonLat, String epsg) {
if (!epsg.equals(geoMap.getMap().getProjection())) {
lonLat.transform(epsg, geoMap.getMap().getProjection());
}
}
示例12: convertLonLat
import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
private LonLat convertLonLat(Wgs84LatLonBean latLon) {
LonLat lonLat = new LonLat(latLon.getLon(), latLon.getLat());
lonLat.transform(WGS84_PROJECTION.getProjectionCode(),
mapProjection.getProjectionCode());
return lonLat;
}
示例13: convertLatLng
import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
private Wgs84LatLonBean convertLatLng(LonLat lonLat) {
LonLat lonLat2 = new LonLat(lonLat.lon(), lonLat.lat());
lonLat2.transform(mapProjection.getProjectionCode(),
WGS84_PROJECTION.getProjectionCode());
return new Wgs84LatLonBean(lonLat2.lat(), lonLat2.lon());
}
示例14: convertLonLat
import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
private LonLat convertLonLat(Wgs84LatLonBean latLon) {
LonLat lonLat = new LonLat(latLon.getLon(), latLon.getLat());
lonLat.transform(WGS84_PROJECTION.getProjectionCode(),
mapProjectionCode);
return lonLat;
}
示例15: toLonLat
import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
private static LonLat toLonLat(final GWTLatLng latLng) {
final LonLat ll = new LonLat(latLng.getLongitude(), latLng.getLatitude());
ll.transform(PROJECTION_LAT_LON.getProjectionCode(), PROJECTION_SPHERICAL_MERCATOR.getProjectionCode());
return ll;
}