本文整理汇总了Java中org.gwtopenmaps.openlayers.client.LonLat类的典型用法代码示例。如果您正苦于以下问题:Java LonLat类的具体用法?Java LonLat怎么用?Java LonLat使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LonLat类属于org.gwtopenmaps.openlayers.client包,在下文中一共展示了LonLat类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onRelease
import org.gwtopenmaps.openlayers.client.LonLat; //导入依赖的package包/类
@Override
protected void onRelease() {
Bounds bounds = geoMap.getMap().getExtent();
LonLat center = bounds.getCenterLonLat();
LonLat lower = new LonLat(bounds.getLowerLeftX(), bounds.getLowerLeftY());
LonLat upper = new LonLat(bounds.getUpperRightX(), bounds.getUpperRightY());
lower = transformToWGS84(lower);
upper = transformToWGS84(upper);
CurrentExtentInfo model = new CurrentExtentInfo();
model.setCenter(center.lat() + ", " + center.lon());
model.setLowerLeftX(lower.lon());
model.setLowerLeftY(lower.lat());
model.setUpperRightX(upper.lon());
model.setUpperRightY(upper.lat());
model.setBounds(bounds);
model.setWkt(getWKT(bounds));
model.setWktWGS84(getWKTToWGS84(bounds));
currentExtentDialog.setModel(model);
currentExtentDialog.setModal(true);
currentExtentDialog.show();
}
示例2: 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);
}
};
}
示例3: 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);
}
}
};
}
示例4: onClick
import org.gwtopenmaps.openlayers.client.LonLat; //导入依赖的package包/类
@Override
public void onClick(MapClickEvent mapClickEvent) {
if (tool.equals("px") || tool.equals("py")) {
if (drawButton.isDown()) {
LonLat click = mapClickEvent.getLonLat();
if (tool.equals("py")) {
setCurrentSelection(getYlo(), getYhi(), click.lon(),
click.lon());
eventBus.fireEventFromSource(new MapChangeEvent(
getYlo(), getYhi(), click.lon(), click.lon()),
this);
} else if (tool.equals("px")) {
setCurrentSelection(click.lat(), click.lat(), getXlo(),
getXhi());
eventBus.fireEventFromSource(
new MapChangeEvent(click.lat(), click.lat(),
getXlo(), getXhi()), this);
}
}
}
}
示例5: addMapControls
import org.gwtopenmaps.openlayers.client.LonLat; //导入依赖的package包/类
@Override
protected void addMapControls(MapOptions mapOptions) {
super.addMapControls(mapOptions);
MousePositionOptions options = new MousePositionOptions();
options.setFormatOutput(new MousePositionOutput() {
@Override
public String format(LonLat lonLat, Map map) {
lonLat.transform(getMapProjection(), EPSG_4326);
StringBuilder sb = new StringBuilder();
sb.append("Lon: ").append(lonLat.lon()).append(", ");
sb.append("Lat: ").append(lonLat.lat());
sb.append(" (").append(map.getProjection()).append(")");
return sb.toString();
}
});
map.addControl(new MousePosition(options));
}
示例6: createVectorFeature
import org.gwtopenmaps.openlayers.client.LonLat; //导入依赖的package包/类
private VectorFeature createVectorFeature(final LonLat lonlat, final String words) {
final Point point = new Point(lonlat.lon(), lonlat.lat());
final VectorFeature pointFeature = new VectorFeature(point);
final Attributes attributes = new Attributes();
attributes.setAttribute("X", String.valueOf(lonlat.lon()));
attributes.setAttribute("Y", String.valueOf(lonlat.lat()));
attributes.setAttribute("w3w", words);
pointFeature.setAttributes(attributes);
return pointFeature;
}
示例7: updateMap
import org.gwtopenmaps.openlayers.client.LonLat; //导入依赖的package包/类
public void updateMap(final double lat, final double lon, final int zoom, String epsg) {
finishProgressBar();
final LonLat lonLat = new LonLat(lon, lat);
transformToInternalProjection(lonLat, epsg);
geoMap.getMap().panTo(lonLat);
geoMap.getMap().setCenter(lonLat, zoom);
}
示例8: setCurrentCoordinate
import org.gwtopenmaps.openlayers.client.LonLat; //导入依赖的package包/类
public void setCurrentCoordinate(LonLat currentCoordinate) {
StatusItem lonItem = getStatusItem(LON_LABEL);
lonItem.setValue(Double.toString(currentCoordinate.lon()));
StatusItem latItem = getStatusItem(LAT_LABEL);
latItem.setValue(Double.toString(currentCoordinate.lat()));
statusStore.update(lonItem);
statusStore.update(latItem);
}
示例9: resizeMap
import org.gwtopenmaps.openlayers.client.LonLat; //导入依赖的package包/类
public void resizeMap() {
// Do a meaningless little calculation to force the map to re-calibrate
// where it is on the page.
int zoom = map.getZoom();
LonLat center = map.getCenter();
map.setCenter(center, zoom);
}
示例10: onMapMove
import org.gwtopenmaps.openlayers.client.LonLat; //导入依赖的package包/类
@Override
public void onMapMove(MapMoveEvent eventObject) {
LonLat center = map.getCenter();
if (modulo && !selectionMade) {
setSelection(new Bounds(center.lon() - 180.0,
center.lat() - 90., center.lon() + 180.0,
center.lat() + 90.));
}
}
示例11: getCenterLatLon
import org.gwtopenmaps.openlayers.client.LonLat; //导入依赖的package包/类
public double[] getCenterLatLon() {
LonLat centerLonLat = map.getCenter();
double[] center = new double[2];
center[0] = centerLonLat.lat();
center[1] = centerLonLat.lon();
return center;
}
示例12: updateDeparturePosition
import org.gwtopenmaps.openlayers.client.LonLat; //导入依赖的package包/类
@Override
public void updateDeparturePosition(Wgs84LatLonBean departurePosition,
boolean autoPan) {
if (departurePosition == null) {
departureWaypoint.hide();
} else {
LonLat lonLat = convertLonLat(departurePosition);
departureWaypoint.moveTo(lonLat);
if (autoPan)
map.panTo(lonLat);
}
waypointLayer.redraw();
}
示例13: updateArrivalPosition
import org.gwtopenmaps.openlayers.client.LonLat; //导入依赖的package包/类
@Override
public void updateArrivalPosition(Wgs84LatLonBean arrivalPosition,
boolean autoPan) {
if (arrivalPosition == null) {
arrivalWaypoint.hide();
} else {
LonLat lonLat = convertLonLat(arrivalPosition);
arrivalWaypoint.moveTo(lonLat);
if (autoPan)
map.panTo(lonLat);
}
}
示例14: handleClickOnMap
import org.gwtopenmaps.openlayers.client.LonLat; //导入依赖的package包/类
private void handleClickOnMap(LonLat lonLat, Pixel pixel) {
if (popupMenu.isShowing()) {
hidePopupMenu();
return;
}
popupMarker.moveTo(lonLat);
popupMenuPosition = lonLat;
popupMenu.setPopupPosition(this.getAbsoluteLeft() + pixel.x() + 2,
this.getAbsoluteTop() + pixel.y() + 2);
popupMenu.show();
}
示例15: printContacts
import org.gwtopenmaps.openlayers.client.LonLat; //导入依赖的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);
}
}