本文整理汇总了Java中org.gwtopenmaps.openlayers.client.MapWidget类的典型用法代码示例。如果您正苦于以下问题:Java MapWidget类的具体用法?Java MapWidget怎么用?Java MapWidget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MapWidget类属于org.gwtopenmaps.openlayers.client包,在下文中一共展示了MapWidget类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: init
import org.gwtopenmaps.openlayers.client.MapWidget; //导入依赖的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);
}
示例3: GeoMap
import org.gwtopenmaps.openlayers.client.MapWidget; //导入依赖的package包/类
public GeoMap() {
final MapOptions defaultMapOptions = new MapOptions();
defaultMapOptions.removeDefaultControls();
mapWidget = new MapWidget("100%", "100%", defaultMapOptions);
getMap().addControl(navHistory);
}
示例4: getMapWidget
import org.gwtopenmaps.openlayers.client.MapWidget; //导入依赖的package包/类
public MapWidget getMapWidget() {
return mapWidget;
}
示例5: 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();
}
});
}
示例6: createMapContent
import org.gwtopenmaps.openlayers.client.MapWidget; //导入依赖的package包/类
private MapWidget createMapContent() {
return controller.createMap();
}
示例7: createMap
import org.gwtopenmaps.openlayers.client.MapWidget; //导入依赖的package包/类
public MapWidget createMap() {
return map.getMapWidget();
}
示例8: createMapContent
import org.gwtopenmaps.openlayers.client.MapWidget; //导入依赖的package包/类
private MapWidget createMapContent() {
OverviewMapController controller = new OverviewMapController();
return controller.createMap(); // TODO refactor
// return new LegendMap().getLayout();
}
示例9: createMap
import org.gwtopenmaps.openlayers.client.MapWidget; //导入依赖的package包/类
public MapWidget createMap() {
return map.getMapWidget();
}
示例10: 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);
}
示例11: getMapWidget
import org.gwtopenmaps.openlayers.client.MapWidget; //导入依赖的package包/类
public MapWidget getMapWidget() {
return mapWidget;
}
示例12: setMapWidget
import org.gwtopenmaps.openlayers.client.MapWidget; //导入依赖的package包/类
public void setMapWidget(MapWidget mapWidget) {
this.mapWidget = mapWidget;
}
示例13: getMapWidget
import org.gwtopenmaps.openlayers.client.MapWidget; //导入依赖的package包/类
/**
* Gets the map widget.
*
* @return the map widget
*/
public MapWidget getMapWidget()
{
return mapWidget;
}
示例14: createMap
import org.gwtopenmaps.openlayers.client.MapWidget; //导入依赖的package包/类
public MapWidget createMap();