本文整理汇总了Java中com.bbn.openmap.gui.BasicMapPanel类的典型用法代码示例。如果您正苦于以下问题:Java BasicMapPanel类的具体用法?Java BasicMapPanel怎么用?Java BasicMapPanel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BasicMapPanel类属于com.bbn.openmap.gui包,在下文中一共展示了BasicMapPanel类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createMapView
import com.bbn.openmap.gui.BasicMapPanel; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected IView<JComponent> createMapView(IMapViewDescriptor viewDescriptor, IActionHandler actionHandler,
Locale locale) {
BasicMapPanel viewComponent = createMapView();
MapBean mapBean = viewComponent.getMapBean();
mapBean.setScale(100000);
MapHandler mapHandler = viewComponent.getMapHandler();
// Add navigation tools over the map
mapHandler.add(new EmbeddedNavPanel());
// Add scale display widget over the map
mapHandler.add(new EmbeddedScaleDisplayPanel());
// Add MouseDelegator, which handles mouse modes (managing mouse
// events)
mapHandler.add(new MouseDelegator());
// Add OMMouseMode, which handles how the map reacts to mouse
// movements
mapHandler.add(new OMMouseMode());
mapHandler.add(new LayerHandler());
MapTileLayer mapTileLayer = new MapTileLayer();
Properties tileProperties = new Properties();
tileProperties.setProperty("rootDir", "http://c.tile.openstreetmap.org/");
mapTileLayer.setProperties(tileProperties);
mapTileLayer.setVisible(true);
mapHandler.add(mapTileLayer);
IModelDescriptor modelDescriptor = viewDescriptor.getModelDescriptor();
String connectorId;
if (modelDescriptor instanceof IPropertyDescriptor) {
connectorId = modelDescriptor.getName();
} else {
connectorId = ModelRefPropertyConnector.THIS_PROPERTY;
}
IValueConnector connector = new JMapViewConnector(connectorId, mapBean, viewDescriptor.getMapContentProperty());
IView<JComponent> view = constructView(viewComponent, viewDescriptor, connector);
return view;
}
示例2: configureMapPanel
import com.bbn.openmap.gui.BasicMapPanel; //导入依赖的package包/类
protected void configureMapPanel(PropertyHandler propertyHandler) {
BasicMapPanel basicMapPanel = new BasicMapPanel(propertyHandler, true);
// Creates the components in the main application thread. If any of
// these components need to update their GUI, they should hand a
// Runnable object to the SwingUtilities.invokeLater(Runnable) method,
// and it will be updated accordingly.
basicMapPanel.create();
mapPanel = basicMapPanel;
}