本文整理汇总了Java中org.gwtopenmaps.openlayers.client.control.MousePosition类的典型用法代码示例。如果您正苦于以下问题:Java MousePosition类的具体用法?Java MousePosition怎么用?Java MousePosition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MousePosition类属于org.gwtopenmaps.openlayers.client.control包,在下文中一共展示了MousePosition类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addMapControls
import org.gwtopenmaps.openlayers.client.control.MousePosition; //导入依赖的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));
}
开发者ID:52North,项目名称:SensorWebClient,代码行数:20,代码来源:StationSelectorMap.java
示例2: init
import org.gwtopenmaps.openlayers.client.control.MousePosition; //导入依赖的package包/类
protected void init(FixedLayerDetails[] additionalLayers) {
this.setStylePrimaryName("mapStyle");
map = this.getMap();
addBaseLayers(additionalLayers);
currentProjection = map.getProjection();
map.addControl(new LayerSwitcher());
map.addControl(new MousePosition());
map.addControl(new PanZoom());
addDrawingLayer();
map.setMaxExtent(new Bounds(-180, -90, 180, 90));
map.setCenter(new LonLat(0.0, 0.0), 2);
map.setFractionalZoom(true);
}
开发者ID:Reading-eScience-Centre,项目名称:edal-java,代码行数:15,代码来源:MapArea.java
示例3: initializeMap
import org.gwtopenmaps.openlayers.client.control.MousePosition; //导入依赖的package包/类
/**
* <p>initializeMap</p>
*/
private void initializeMap() {
final MapOptions mo = new MapOptions();
mo.setProjection(PROJECTION_SPHERICAL_MERCATOR.getProjectionCode());
mo.setDisplayProjection(PROJECTION_LAT_LON);
mo.setMaxExtent(new Bounds(-180, -90, 180, 90).transform(PROJECTION_LAT_LON,PROJECTION_SPHERICAL_MERCATOR));
m_mapWidget = new MapWidget("100%", "100%", mo);
m_mapHolder.add(m_mapWidget);
m_map = m_mapWidget.getMap();
m_map.addControl(new PanZoomBar());
m_map.addControl(new MousePosition());
m_map.zoomTo(2);
initializeImageError();
XYZOptions xyzOptions = new XYZOptions();
xyzOptions.setSphericalMercator(true);
xyzOptions.setAttribution("Default tiles courtesy of <a href=\"http://open.mapquest.co.uk/\">MapQuest</a>");
XYZ x = new XYZ("OpenStreetMap", getLayerUrl(), xyzOptions);
x.setIsBaseLayer(true);
x.setIsVisible(true);
m_map.addLayer(x);
m_markersLayer = new Markers("Remote Pollers");
m_markersLayer.setIsVisible(true);
m_markersLayer.setIsBaseLayer(false);
m_map.addLayer(m_markersLayer);
/*
final LayerSwitcher switcher = new LayerSwitcher();
m_map.addControl(switcher);
*/
m_map.zoomToMaxExtent();
Window.addResizeHandler(new ResizeHandler() {
public void onResize(ResizeEvent event) {
syncMapSizeWithParent();
}
});
}
开发者ID:qoswork,项目名称:opennmszh,代码行数:45,代码来源:OpenLayersMapPanel.java
注:本文中的org.gwtopenmaps.openlayers.client.control.MousePosition类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论