本文整理汇总了Java中org.gwtopenmaps.openlayers.client.MapWidget.getMap方法的典型用法代码示例。如果您正苦于以下问题:Java MapWidget.getMap方法的具体用法?Java MapWidget.getMap怎么用?Java MapWidget.getMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.gwtopenmaps.openlayers.client.MapWidget
的用法示例。
在下文中一共展示了MapWidget.getMap方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initMapWidget
import org.gwtopenmaps.openlayers.client.MapWidget; //导入方法依赖的package包/类
/**
* Inits the map widget.
*
* @param defaultMapOptions
* the default map options
* @param isGoogle
* the is google
*/
private void initMapWidget(MapOptions defaultMapOptions, boolean isGoogle)
{
mapWidget = new MapWidget("100%", "100%", defaultMapOptions);
this.map = mapWidget.getMap();
// this.map.addControl(new LayerSwitcher());
if (isGoogle)
{
this.createOSM();
// this.createBaseGoogleLayer();
}
else
{
WMSParams wmsParams = new WMSParams();
wmsParams.setFormat("image/png");
wmsParams.setLayers("basic");
wmsParams.setStyles("");
WMSOptions wmsLayerParams = new WMSOptions();
wmsLayerParams.setTransitionEffect(TransitionEffect.RESIZE);
layer = new WMS("Basic WMS", "http://labs.metacarta.com/wms/vmap0", wmsParams,
wmsLayerParams);
this.map.addLayer(layer);
}
this.initVectorLayer();
}
示例2: initializeMap
import org.gwtopenmaps.openlayers.client.MapWidget; //导入方法依赖的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();
}
});
}
示例3: initializeMapWidget
import org.gwtopenmaps.openlayers.client.MapWidget; //导入方法依赖的package包/类
private void initializeMapWidget(String cssHeight) {
initializeDefaultMapOptions();
mapWidget = new MapWidget("100%", cssHeight, defaultMapOptions);
map = mapWidget.getMap();
addMapControls(defaultMapOptions);
}