Codota Logo
org.mapsforge.map.controller
Code IndexAdd Codota to your IDE (free)

How to use org.mapsforge.map.controller

Best Java code snippets using org.mapsforge.map.controller (Showing top 19 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: mapsforge/mapsforge

public static MapViewController create(MapView mapView, Model model) {
  MapViewController mapViewController = new MapViewController(mapView);
  model.mapViewPosition.addObserver(mapViewController);
  return mapViewController;
}
origin: mapsforge/mapsforge

public static LayerManagerController create(LayerManager layerManager, Model model) {
  LayerManagerController layerManagerController = new LayerManagerController(layerManager);
  model.mapViewDimension.addObserver(layerManagerController);
  model.mapViewPosition.addObserver(layerManagerController);
  return layerManagerController;
}
origin: mapsforge/mapsforge

public MapView() {
  super();
  this.model = new Model();
  this.fpsCounter = new FpsCounter(GRAPHIC_FACTORY, this.model.displayModel);
  this.frameBuffer = new FrameBufferHA2(this.model.frameBufferModel, this.model.displayModel, GRAPHIC_FACTORY);
  this.frameBufferController = FrameBufferController.create(this.frameBuffer, this.model);
  this.layerManager = new LayerManager(this, this.model.mapViewPosition, GRAPHIC_FACTORY);
  this.layerManager.start();
  LayerManagerController.create(this.layerManager, this.model);
  MapViewController.create(this, this.model);
  this.mapScaleBar = new DefaultMapScaleBar(this.model.mapViewPosition, this.model.mapViewDimension, GRAPHIC_FACTORY,
      this.model.displayModel);
  this.mapViewProjection = new MapViewProjection(this);
  addListeners();
}
origin: mapsforge/mapsforge

if (dimensionChangeNeeded(mapViewDimension, overdrawFactor)) {
  Dimension newDimension = calculateFrameBufferDimension(mapViewDimension, overdrawFactor);
  if (!Parameters.SQUARE_FRAME_BUFFER || frameBuffer.getDimension() == null
      || newDimension.width > frameBuffer.getDimension().width
      double scaleFactor = this.model.mapViewPosition.getScaleFactor();
      LatLong pivot = this.model.mapViewPosition.getPivot();
      adjustFrameBufferMatrix(mapPositionFrameBuffer, mapViewDimension, scaleFactor, pivot);
origin: mapsforge/mapsforge

  @Test
  public void repaintTest() {
    DummyMapView dummyMapView = new DummyMapView();
    Model model = new Model();
    MapViewController.create(dummyMapView, model);
    Assert.assertEquals(0, dummyMapView.repaintCounter);

    model.mapViewPosition.setZoomLevel((byte) 1);
    // this does not hold with zoom animation
    // Assert.assertEquals(1, dummyMapView.repaintCounter);
  }
}
origin: mapsforge/mapsforge

/**
 * Clear map view.
 */
@Override
public void destroy() {
  this.layerManager.finish();
  this.frameBufferController.destroy();
  this.frameBuffer.destroy();
  if (this.mapScaleBar != null) {
    this.mapScaleBar.destroy();
  }
  this.getModel().mapViewPosition.destroy();
}
origin: mapsforge/mapsforge

/**
 * Compute the minimum cache size for a view, using the size of the map view.
 * For the view size we use the frame buffer calculated dimension.
 *
 * @param tileSize       the tile size
 * @param overdrawFactor the overdraw factor applied to the mapview
 * @param width          the width of the map view
 * @param height         the height of the map view
 * @return the minimum cache size for the view
 */
public static int getMinimumCacheSize(int tileSize, double overdrawFactor, int width, int height) {
  // height * overdrawFactor / tileSize calculates the number of tiles that would cover
  // the view port, adding 1 is required since we can have part tiles on either side,
  // adding 2 adds another row/column as spare and ensures that we will generally have
  // a larger number of tiles in the cache than a TileLayer will render for a view.
  // For any size we need a minimum of 4 (as the intersection of 4 tiles can always be in the
  // middle of a view.
  Dimension dimension = FrameBufferController.calculateFrameBufferDimension(new Dimension(width, height), overdrawFactor);
  return Math.max(4, (2 + (dimension.height / tileSize))
      * (2 + (dimension.width / tileSize)));
}
origin: mapsforge/mapsforge

public static FrameBufferController create(FrameBuffer frameBuffer, Model model) {
  FrameBufferController frameBufferController = new FrameBufferController(frameBuffer, model);
  model.frameBufferModel.addObserver(frameBufferController);
  model.mapViewDimension.addObserver(frameBufferController);
  model.mapViewPosition.addObserver(frameBufferController);
  model.displayModel.addObserver(frameBufferController);
  return frameBufferController;
}
origin: cpesch/RouteConverter

public AwtGraphicMapView() {
  super();
  this.model = new Model();
  this.fpsCounter = new FpsCounter(GRAPHIC_FACTORY, model.displayModel);
  this.frameBuffer = new FrameBuffer(model.frameBufferModel, model.displayModel, GRAPHIC_FACTORY);
  this.frameBufferController = FrameBufferController.create(frameBuffer, model);
  this.layerManager = new LayerManager(this, model.mapViewPosition, GRAPHIC_FACTORY);
  this.layerManager.start();
  LayerManagerController.create(layerManager, model);
  MapViewController.create(this, model);
  this.mapScaleBar = new DefaultMapScaleBar(model.mapViewPosition, model.mapViewDimension, GRAPHIC_FACTORY, model.displayModel);
  this.mapViewProjection = new MapViewProjection(this);
}
origin: org.mapsforge/mapsforge-map

if (dimensionChangeNeeded(mapViewDimension, overdrawFactor)) {
  Dimension newDimension = calculateFrameBufferDimension(mapViewDimension, overdrawFactor);
  if (!Parameters.SQUARE_FRAME_BUFFER || frameBuffer.getDimension() == null
      || newDimension.width > frameBuffer.getDimension().width
      double scaleFactor = this.model.mapViewPosition.getScaleFactor();
      LatLong pivot = this.model.mapViewPosition.getPivot();
      adjustFrameBufferMatrix(mapPositionFrameBuffer, mapViewDimension, scaleFactor, pivot);
origin: cpesch/RouteConverter

public void destroy() {
  layerManager.interrupt();
  frameBufferController.destroy();
  frameBuffer.destroy();
  if (mapScaleBar != null)
    mapScaleBar.destroy();
  getModel().mapViewPosition.destroy();
}
origin: mapsforge/mapsforge

Dimension dimension = FrameBufferController.calculateFrameBufferDimension(new Dimension(width, height), overdrawFactor);
return (int) Math.max(4, screenRatio * (2 + (dimension.height / tileSize))
    * (2 + (dimension.width / tileSize)));
origin: org.mapsforge/mapsforge-map

public static MapViewController create(MapView mapView, Model model) {
  MapViewController mapViewController = new MapViewController(mapView);
  model.mapViewPosition.addObserver(mapViewController);
  return mapViewController;
}
origin: org.mapsforge/mapsforge-map

public static LayerManagerController create(LayerManager layerManager, Model model) {
  LayerManagerController layerManagerController = new LayerManagerController(layerManager);
  model.mapViewDimension.addObserver(layerManagerController);
  model.mapViewPosition.addObserver(layerManagerController);
  return layerManagerController;
}
origin: org.mapsforge/mapsforge-map

public static FrameBufferController create(FrameBuffer frameBuffer, Model model) {
  FrameBufferController frameBufferController = new FrameBufferController(frameBuffer, model);
  model.frameBufferModel.addObserver(frameBufferController);
  model.mapViewDimension.addObserver(frameBufferController);
  model.mapViewPosition.addObserver(frameBufferController);
  model.displayModel.addObserver(frameBufferController);
  return frameBufferController;
}
origin: org.mapsforge/mapsforge-map-awt

public MapView() {
  super();
  this.model = new Model();
  this.fpsCounter = new FpsCounter(GRAPHIC_FACTORY, this.model.displayModel);
  this.frameBuffer = new FrameBufferHA2(this.model.frameBufferModel, this.model.displayModel, GRAPHIC_FACTORY);
  this.frameBufferController = FrameBufferController.create(this.frameBuffer, this.model);
  this.layerManager = new LayerManager(this, this.model.mapViewPosition, GRAPHIC_FACTORY);
  this.layerManager.start();
  LayerManagerController.create(this.layerManager, this.model);
  MapViewController.create(this, this.model);
  this.mapScaleBar = new DefaultMapScaleBar(this.model.mapViewPosition, this.model.mapViewDimension, GRAPHIC_FACTORY,
      this.model.displayModel);
  this.mapViewProjection = new MapViewProjection(this);
  addListeners();
}
origin: org.mapsforge/mapsforge-map-awt

/**
 * Clear map view.
 */
@Override
public void destroy() {
  this.layerManager.finish();
  this.frameBufferController.destroy();
  this.frameBuffer.destroy();
  if (this.mapScaleBar != null) {
    this.mapScaleBar.destroy();
  }
  this.getModel().mapViewPosition.destroy();
}
origin: mapsforge/mapsforge

public MapView(Context context, AttributeSet attributeSet) {
  super(context, attributeSet);
  setDescendantFocusability(FOCUS_BLOCK_DESCENDANTS);
  setWillNotDraw(false);
  this.model = new Model();
  this.fpsCounter = new FpsCounter(GRAPHIC_FACTORY, this.model.displayModel);
  this.frameBuffer = new FrameBufferHA2(this.model.frameBufferModel, this.model.displayModel, GRAPHIC_FACTORY);
  this.frameBufferController = FrameBufferController.create(this.frameBuffer, this.model);
  this.layerManager = new LayerManager(this, this.model.mapViewPosition, GRAPHIC_FACTORY);
  this.layerManager.start();
  LayerManagerController.create(this.layerManager, this.model);
  MapViewController.create(this, this.model);
  this.touchGestureHandler = new TouchGestureHandler(this);
  this.gestureDetector = new GestureDetector(context, touchGestureHandler);
  this.scaleGestureDetector = new ScaleGestureDetector(context, touchGestureHandler);
  this.mapZoomControls = new MapZoomControls(context, this);
  this.addView(this.mapZoomControls, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
  this.mapScaleBar = new DefaultMapScaleBar(this.model.mapViewPosition, this.model.mapViewDimension,
      GRAPHIC_FACTORY, this.model.displayModel);
  this.mapViewProjection = new MapViewProjection(this);
  model.mapViewPosition.addObserver(this);
}
origin: mapsforge/mapsforge

/**
 * Clear map view.
 */
@Override
public void destroy() {
  this.touchGestureHandler.destroy();
  this.layoutHandler.removeCallbacksAndMessages(null);
  this.layerManager.finish();
  this.frameBufferController.destroy();
  this.frameBuffer.destroy();
  if (this.mapScaleBar != null) {
    this.mapScaleBar.destroy();
  }
  this.mapZoomControls.destroy();
  this.getModel().mapViewPosition.destroy();
}
org.mapsforge.map.controller

Most used classes

  • MapViewController
  • FrameBufferController
  • LayerManagerController
  • DummyMapView
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now