メインコンテンツまでスキップ

User interaction handlers

Items related to the ways in which the map responds to user input.

BoxZoomHandler

githubsrc/ui/handler/box_zoom.ts

The BoxZoomHandler allows the user to zoom the map to fit within a bounding box. The bounding box is defined by clicking and holding shift while dragging the cursor.

Instance Members

このsection on BoxZoomHandlerは役に立ちましたか?

DoubleClickZoomHandler

githubsrc/ui/handler/shim/dblclick_zoom.ts

The DoubleClickZoomHandler allows the user to zoom the map at a point by double clicking or double tapping.

Instance Members

このsection on DoubleClickZoomHandlerは役に立ちましたか?

DragPanHandler

githubsrc/ui/handler/shim/drag_pan.ts

The DragPanHandler allows the user to pan the map by clicking and dragging the cursor.

Instance Members

このsection on DragPanHandlerは役に立ちましたか?

DragRotateHandler

githubsrc/ui/handler/shim/drag_rotate.ts

The DragRotateHandler allows the user to rotate the map by clicking and dragging the cursor while holding the right mouse button or ctrl key.

Instance Members

このsection on DragRotateHandlerは役に立ちましたか?

FeaturesetDescriptor

githubsrc/util/vectortile_to_geojson.ts

FeaturesetDescriptor references a featureset in a style. If importId is not specified, the featureset is assumed to be in the root style.

{featuresetId: string, importId: string?}

Properties

featuresetId(string)
importId(string?)
このsection on FeaturesetDescriptorは役に立ちましたか?

Interaction

githubsrc/ui/interactions.ts

Interaction is a configuration object used with Map#addInteraction to handle user events, such as clicks and hovers. Interactions can be applied globally or to specific targets, such as layers or featuresets.

{type: MapInteractionEventType, target: TargetDescriptor?, namespace: string?, filter: FilterSpecification?, handler: function (event: InteractionEvent): (boolean | void)}

Properties

filter(FilterSpecification?)
handler(function (event: InteractionEvent): (boolean | void))
namespace(string?)
type(MapInteractionEventType)

Static Members

このsection on Interactionは役に立ちましたか?

InteractionEvent

githubsrc/ui/interactions.ts

InteractionEvent is an event object that is passed to the interaction handler.

Extends Event.

Instance Members

このsection on InteractionEventは役に立ちましたか?

KeyboardHandler

githubsrc/ui/handler/keyboard.ts

The KeyboardHandler allows the user to zoom, rotate, and pan the map using the following keyboard shortcuts:

  • = / +: Increase the zoom level by 1.
  • Shift-= / Shift-+: Increase the zoom level by 2.
  • -: Decrease the zoom level by 1.
  • Shift--: Decrease the zoom level by 2.
  • Arrow keys: Pan by 100 pixels.
  • Shift+⇢: Increase the rotation by 15 degrees.
  • Shift+⇠: Decrease the rotation by 15 degrees.
  • Shift+⇡: Increase the pitch by 10 degrees.
  • Shift+⇣: Decrease the pitch by 10 degrees.

Instance Members

このsection on KeyboardHandlerは役に立ちましたか?

ScrollZoomHandler

githubsrc/ui/handler/scroll_zoom.ts

The ScrollZoomHandler allows the user to zoom the map by scrolling.

Instance Members

このsection on ScrollZoomHandlerは役に立ちましたか?

TargetDescriptor

githubsrc/util/vectortile_to_geojson.ts

TargetDescriptor defines the target for a Map#queryRenderedFeatures query to inspect, referencing either a style layer ID or a FeaturesetDescriptor. It acts as a universal target for Map#addInteraction and Map#queryRenderedFeatures.

({layerId: string} | FeaturesetDescriptor)
このsection on TargetDescriptorは役に立ちましたか?

TargetFeature

githubsrc/util/vectortile_to_geojson.ts

TargetFeature is a GeoJSON Feature object representing a feature associated with a specific query target in Map#queryRenderedFeatures. For featuresets in imports, TargetFeature includes a target reference as a TargetDescriptor and may also include a namespace property to prevent feature ID collisions when layers defined in the query target reference multiple sources. Unlike features returned for root style featuresets, TargetFeature omits the layer, source, and sourceLayer properties if the feature belongs to import style.

Extends Feature.

Instance Members

このsection on TargetFeatureは役に立ちましたか?

TouchPitchHandler

githubsrc/ui/handler/touch_zoom_rotate.ts

The TouchPitchHandler allows the user to pitch the map by dragging up and down with two fingers.

Extends TwoTouchHandler.
new TouchPitchHandler(map: Map)

Parameters

map(Map)
このsection on TouchPitchHandlerは役に立ちましたか?

TouchZoomRotateHandler

githubsrc/ui/handler/shim/touch_zoom_rotate.ts

The TouchZoomRotateHandler allows the user to zoom and rotate the map by pinching on a touchscreen.

They can zoom with one finger by double tapping and dragging. On the second tap, hold the finger down and drag up or down to zoom in or out.

Instance Members

このsection on TouchZoomRotateHandlerは役に立ちましたか?
このpageは役に立ちましたか?