本文整理汇总了Java中org.gwtopenmaps.openlayers.client.LonLat.lat方法的典型用法代码示例。如果您正苦于以下问题:Java LonLat.lat方法的具体用法?Java LonLat.lat怎么用?Java LonLat.lat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.gwtopenmaps.openlayers.client.LonLat
的用法示例。
在下文中一共展示了LonLat.lat方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: PlotPointsRuskin
import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的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);
}
}
示例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: 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;
}
示例6: 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());
}
示例7: updatePOIList
import org.gwtopenmaps.openlayers.client.LonLat; //导入方法依赖的package包/类
public void updatePOIList(String sourceId,
java.util.Map<String, POIBean> pois) {
// Remove only POI coming from the same sourceId
if (layer.getFeatures() != null) {
for (VectorFeature feature : layer.getFeatures()) {
String poiSource = feature.getAttributes()
.getAttributeAsString("sourceId");
if (poiSource.equals(sourceId))
layer.removeFeature(feature);
}
}
// Order POI on z-index = latitude
List<POIBean> poiList = new ArrayList<POIBean>(pois.values());
Collections.sort(poiList, new Comparator<POIBean>() {
@Override
public int compare(POIBean o1, POIBean o2) {
double delta = o2.getLocation().getLat()
- o1.getLocation().getLat();
return delta < 0.0 ? -1 : +1;
}
});
for (POIBean poi : poiList) {
ImageResource imageResource = POIUtils.getPoiIcon(poi.getType());
String imageUrl = imageResource.getSafeUri().asString();
Style pointStyle = new Style();
pointStyle.setExternalGraphic(imageUrl);
pointStyle.setGraphicSize(imageResource.getWidth(),
imageResource.getHeight());
// HACK ALERT! Assume all POI icons the same size.
Pixel anchor = new Pixel(-12, -30);
pointStyle.setGraphicOffset(anchor.x(), anchor.y());
pointStyle.setFillOpacity(1.0);
pointStyle.setStrokeOpacity(1.0);
LonLat position = convertLonLat(poi.getLocation());
Point point = new Point(position.lon(), position.lat());
VectorFeature marker = new VectorFeature(point, pointStyle);
// TODO Set POI name as <h3>title</h3>?
marker.getAttributes().setAttribute(
OpenLayersPlannerMapWidget.POPUP_CONTENT_KEY,
poi.getHtmlDescription());
marker.getAttributes().setAttribute(
OpenLayersPlannerMapWidget.POPUP_CLASS_KEY, "poi-popup");
layer.addFeature(marker);
}
layer.setDisplayInLayerSwitcher(!poiList.isEmpty());
}