Class MapRenderer

java.lang.Object
com.massifmaps.renderers.MapRenderer

public class MapRenderer extends Object
The map renderer component.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    captureRendering(RendererCaptureListener listener, boolean waitWhileUpdating)
    Captures map rendering as a bitmap.
    void
    drawMaskQuad(long texture, float invWidth, float invHeight)
     
    boolean
    Checks if this object is equal to the specified object.
    Returns the map renderer listener.
    Returns the current post-process effect.
    Returns the terrain renderer (may be null).
    Returns the current view state.
    int
    Returns the hash value of this object.
    void
    multiplyScreenMask(long texture, float invWidth, float invHeight)
     
    void
    Requests the renderer to refresh the view.
    Note that there is normally no need to do this manually,
    SDK automatically redraws the view when needed.
    The default arguments record the CALL SITE, so a view that never stops redrawing can
    say which of the ~30 callers is driving it (logRedrawSources below).
    void
    requestRedraw(String callerFile)
    Requests the renderer to refresh the view.
    Note that there is normally no need to do this manually,
    SDK automatically redraws the view when needed.
    The default arguments record the CALL SITE, so a view that never stops redrawing can
    say which of the ~30 callers is driving it (logRedrawSources below).
    void
    requestRedraw(String callerFile, int callerLine)
    Requests the renderer to refresh the view.
    Note that there is normally no need to do this manually,
    SDK automatically redraws the view when needed.
    The default arguments record the CALL SITE, so a view that never stops redrawing can
    say which of the ~30 callers is driving it (logRedrawSources below).
    void
    Forgets that the camera has been moved.
    void
    Sets the map renderer listener.
    void
    Sets the post-process effect.

    Methods inherited from class java.lang.Object

    clone, getClass, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • equals

      public boolean equals(Object obj)
      Checks if this object is equal to the specified object.
      Overrides:
      equals in class Object
      Parameters:
      obj - The reference object.
      Returns:
      True when objects are equal, false otherwise.
    • hashCode

      public int hashCode()
      Returns the hash value of this object.
      Overrides:
      hashCode in class Object
      Returns:
      The hash value of this object.
    • resetCameraPlaced

      public void resetCameraPlaced()
      Forgets that the camera has been moved. The view a map is constructed with is the SDK's
      own, not a placed camera, and the auto-flatten rule does not judge it - see AutoFlatten.
    • getMapRendererListener

      public MapRendererListener getMapRendererListener()
      Returns the map renderer listener. Can be null.
      Returns:
      The map renderer listener.
    • setMapRendererListener

      public void setMapRendererListener(MapRendererListener listener)
      Sets the map renderer listener.
      Parameters:
      listener - The new map renderer listener. Can be null.
    • getViewState

      public ViewState getViewState()
      Returns the current view state.
      Returns:
      The current view state.
    • requestRedraw

      public void requestRedraw(String callerFile, int callerLine)
      Requests the renderer to refresh the view.
      Note that there is normally no need to do this manually,
      SDK automatically redraws the view when needed.
      The default arguments record the CALL SITE, so a view that never stops redrawing can
      say which of the ~30 callers is driving it (logRedrawSources below). Callers pass
      nothing; the compiler fills these in.
    • requestRedraw

      public void requestRedraw(String callerFile)
      Requests the renderer to refresh the view.
      Note that there is normally no need to do this manually,
      SDK automatically redraws the view when needed.
      The default arguments record the CALL SITE, so a view that never stops redrawing can
      say which of the ~30 callers is driving it (logRedrawSources below). Callers pass
      nothing; the compiler fills these in.
    • requestRedraw

      public void requestRedraw()
      Requests the renderer to refresh the view.
      Note that there is normally no need to do this manually,
      SDK automatically redraws the view when needed.
      The default arguments record the CALL SITE, so a view that never stops redrawing can
      say which of the ~30 callers is driving it (logRedrawSources below). Callers pass
      nothing; the compiler fills these in.
    • captureRendering

      public void captureRendering(RendererCaptureListener listener, boolean waitWhileUpdating)
      Captures map rendering as a bitmap. This operation is asynchronous and the result is returned via listener callback.
      Parameters:
      listener - The listener interface that will receive the callback once rendering is available.
      waitWhileUpdating - If true, delay the capture until all asynchronous processes are finished (for example, until all tiles are loaded).
    • getPostProcessEffect

      public PostProcessEffect getPostProcessEffect()
      Returns the current post-process effect. Can be null.
      Returns:
      The current post-process effect.
    • setPostProcessEffect

      public void setPostProcessEffect(PostProcessEffect postProcessEffect)
      Sets the post-process effect. When set, the map is rendered into an offscreen
      buffer and the effect fragment shader produces the final screen output.
      Note: this feature is experimental and may change in future SDK versions.
      Parameters:
      postProcessEffect - The new post-process effect. Can be null.
    • getTerrainRenderer

      public SWIGTYPE_p_massif__TerrainRenderer getTerrainRenderer()
      Returns the terrain renderer (may be null). GL thread only. Internal method.
    • drawMaskQuad

      public void drawMaskQuad(long texture, float invWidth, float invHeight)
    • multiplyScreenMask

      public void multiplyScreenMask(long texture, float invWidth, float invHeight)