@maplibre/native-ffi
    Preparing search index...

    Class MapHandleDiscarding

    The commands of a MapHandle that discard their outcomes: each returns once native code accepts it and allocates no completion. A later completion on the same map fences them.

    Index
    • Moves the camera relative to where it is, as a gesture does.

      delta can pan the map's content by an offset on the screen, scale the zoom, and add to the bearing and pitch. An anchor keeps one screen point in place while the scale, bearing, or pitch changes. An anchor needs one of those changes, and combines with an offset only when the delta has no animation. The function finishes when the map applies the delta, before an animation ends.

      A delta that replaces an animated one starts from where that animation left the camera, so the rest of the replaced change never happens. To reach an exact camera, use MapHandle.updateCamera().

      A delta in the end phase can carry momentum, which keeps the camera moving from the gesture's release velocities and slows it on each rendered frame. The gesture lasts until the momentum ends: the snapshot keeps gesture_in_progress set, and camera events report CameraChangeSource.momentum. With momentum, animation sets only transition_id and the end handler, which runs when the gesture ends.

      A delta in the begin phase, MapHandle.cancelCameraTransitions(), or a cancellation by that ID stops the momentum. A later command that sets a field stops only the parts of the momentum that move that field. On a tilted map, the pan moves the map's content the same distance on the screen in every direction.

      See mln_map_apply_camera_delta in the C API reference.

      Parameters

      Returns void

    • Holds back the map's changes from rendering until MapHandle.endCommandGroup(), so they show in the same frame.

      Groups nest, and the changes render when the outermost group ends.

      See mln_map_begin_command_group in the C API reference.

      Returns void

    • Stops the running camera animations whose animation options set transitionId.

      Other animations keep running. The end handler of each stopped animation reports CameraTransitionOutcome.cancelled.

      See mln_map_cancel_camera_transitions_with_id in the C API reference.

      Parameters

      • transitionId: bigint

      Returns void

    • Moves the camera to fit a GeoJSON geometry in the map's view, at once or with an animation.

      geometry is a GeoJSON geometry object with at least one coordinate, not a feature. The camera is the one that MapHandle.cameraForGeometry() computes after the commands sent before this one apply. The function finishes when the map applies the change, before an animation ends.

      See mln_map_fit_camera_to_geometry in the C API reference.

      Parameters

      Returns void

    • Moves the camera to fit coordinates in the map's view, at once or with an animation.

      coordinates must not be empty. The camera is the one that MapHandle.cameraForLatLngs() computes after the commands sent before this one apply. The function finishes when the map applies the change, before an animation ends.

      See mln_map_fit_camera_to_lat_lngs in the C API reference.

      Parameters

      Returns void

    • Moves a layer of the map's style below the layer named beforeLayerId, or above every layer when beforeLayerId is empty.

      See mln_map_move_style_layer in the C API reference.

      Parameters

      • layerId: string
      • OptionalbeforeLayerId: string

      Returns void

    • Sets the data of a tile in a custom geometry source.

      data is a GeoJSON feature collection, feature, or geometry. The source ignores data for a tile that it hasn't asked for, or has since cancelled.

      See mln_map_set_custom_geometry_source_tile_data in the C API reference.

      Parameters

      Returns void

    • Replaces the data of a GeoJSON source.

      data is a GeoJSON feature collection, feature, or geometry. The library prepares it for the source with the source's options, off the threads that the caller and the runtime use, and the command completes once the source holds it. Later commands don't wait for it. While the source is still preparing earlier data, only the newest data waits to follow it.

      With synchronous tiling on, as MapHandle.setGeoJsonSourceSynchronousTiling() describes, the command prepares data before later commands run, so the data shows in the next frame.

      See mln_map_set_geo_json_source_data in the C API reference.

      Parameters

      • sourceId: string
      • data: unknown

      Returns void

    • Sets whether a GeoJSON source builds its tiles while the map renders.

      Building tiles while the map renders, instead of in the background, makes new data show in the next frame. The setting replaces the synchronousUpdate member of the source's JSON, which defaults to false.

      See mln_map_set_geo_json_source_synchronous_tiling in the C API reference.

      Parameters

      • sourceId: string
      • enabled: boolean

      Returns void

    • Moves the image of an image source.

      coordinates are the image's four corners, clockwise from the top left.

      See mln_map_set_image_source_coordinates in the C API reference.

      Parameters

      • sourceId: string
      • coordinates: readonly LatLng[]

      Returns void

    • Loads the map's style from json.

      The command completes once the style has parsed, and the map's style is then loaded, as MapHandle.setStyleUrl() describes. The style's sources, sprites, and glyphs load in the background.

      See mln_map_set_style_json in the C API reference.

      Parameters

      • json: unknown

      Returns void

    • Sets a property of a layer in the map's style.

      propertyName is one of the layer's layout or paint [properties](https://maplibre.org/maplibre-style-spec/layers/), or filter, minzoom, maxzoom, source, or source-layer. A null value resets any of these but source and source-layer to its default.

      See mln_map_set_style_layer_property in the C API reference.

      Parameters

      • layerId: string
      • propertyName: string
      • value: unknown

      Returns void

    • Sets whether a source is volatile.

      The map doesn't store the tiles of a volatile source in the persistent cache.

      See mln_map_set_style_source_volatile in the C API reference.

      Parameters

      • sourceId: string
      • isVolatile: boolean

      Returns void

    • Loads the map's style from url.

      The command completes once the style document has loaded and parsed. The style's sources, sprites, and glyphs then load in the background.

      The map's style is loaded from the time a style document parses until the next call to this function. While the style isn't loaded, the commands that change it complete with Status.invalidState. To change a new map's style without a style document, first load an empty style, such as {"version":8,"sources":{},"layers":[]}.

      See mln_map_set_style_url in the C API reference.

      Parameters

      • url: string

      Returns void

    • Moves the camera, at once or with an animation.

      Camera fields that update doesn't set keep their values, and the update stops any running animation of the fields it sets. The function finishes when the map applies the update, before an animation ends. To learn when an animation ends, set an CameraTransitionHandler in its animation options.

      See mln_map_update_camera in the C API reference.

      Parameters

      Returns void