From 0ef118b045f59da38fa3153a0456787e8788073d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thor=20=E9=9B=B7=E7=A5=9E=20Schaeff?= <5748289+thorwebdev@users.noreply.github.com> Date: Mon, 8 Jul 2024 01:03:26 +0800 Subject: [PATCH] Update marker.md (#2367) --- docs/api-reference/marker.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/api-reference/marker.md b/docs/api-reference/marker.md index bb697f7d6..8d59ac79b 100644 --- a/docs/api-reference/marker.md +++ b/docs/api-reference/marker.md @@ -63,27 +63,27 @@ If `Marker` is mounted with child components, then its content will be rendered ### Reactive Properties -#### `draggable`: boolean {#draggable} +#### `draggable`: boolean {#draggable} Default: `false` If `true`, the marker is able to be dragged to a new position on the map. -#### `latitude`: number {#latitude} +#### `latitude`: number {#latitude} Required. The latitude of the anchor location. -#### `longitude`: number {#longitude} +#### `longitude`: number {#longitude} Required. The longitude of the anchor location. -#### `offset`: [PointLike](./types.md#pointlike) {#offset} +#### `offset`: [PointLike](./types.md#pointlike) {#offset} Default: `null` The offset in pixels as a [PointLike](https://docs.mapbox.com/mapbox-gl-js/api/geography/#pointlike) object to apply relative to the element's center. Negatives indicate left and up. -#### `pitchAlignment`: 'map' | 'viewport' | 'auto' {#pitchalignment} +#### `pitchAlignment`: 'map' | 'viewport' | 'auto' {#pitchalignment} Default: `'auto'` @@ -91,17 +91,17 @@ Default: `'auto'` - `viewport` aligns the `Marker` to the plane of the viewport. - `auto` automatically matches the value of `rotationAlignment`. -#### `popup`: Popup | null {#popup} +#### `popup`: Popup | null {#popup} An instance of the `Popup` class ([Mapbox](https://docs.mapbox.com/mapbox-gl-js/api/markers/#popup) | [Maplibre](https://maplibre.org/maplibre-gl-js/docs/API/classes/Popup/)) to attach to this marker. If undefined or null, any popup set on this Marker instance is unset. -#### `rotation`: number {#rotation} +#### `rotation`: number {#rotation} Default: `0` The rotation angle of the marker in degrees, relative to its `rotationAlignment` setting. A positive value will rotate the marker clockwise. -#### `rotationAlignment`: 'map' | 'viewport' | 'auto' {#rotationalignment} +#### `rotationAlignment`: 'map' | 'viewport' | 'auto' {#rotationalignment} Default: `'auto'` @@ -109,25 +109,25 @@ Default: `'auto'` - `viewport` aligns the `Marker`'s rotation relative to the viewport, agnostic to map rotations. - `auto` is equivalent to `viewport`. -#### `style`: CSSProperties {#style} +#### `style`: CSSProperties {#style} CSS style override that applies to the marker's container. ### Callbacks -#### `onClick`: (evt: [MapEvent](./types.md#mapevent)) => void {#onclick} +#### `onClick`: (evt: [MapEvent](./types.md#mapevent)) => void {#onclick} Called when the marker is clicked on. -#### `onDragStart`: (evt: [MarkerDragEvent](./types.md#markerdragevent)) => void {#ondragstart} +#### `onDragStart`: (evt: [MarkerDragEvent](./types.md#markerdragevent)) => void {#ondragstart} Called when dragging starts, if `draggable` is `true`. -#### `onDrag`: (evt: [MarkerDragEvent](./types.md#markerdragevent)) => void {#ondrag} +#### `onDrag`: (evt: [MarkerDragEvent](./types.md#markerdragevent)) => void {#ondrag} Called while dragging, if `draggable` is `true`. -#### `onDragEnd`: (evt: [MarkerDragEvent](./types.md#markerdragevent)) => void {#ondragend} +#### `onDragEnd`: (evt: [MarkerDragEvent](./types.md#markerdragevent)) => void {#ondragend} Called when dragging ends, if `draggable` is `true`. @@ -192,7 +192,7 @@ function App() { const markerRef = useRef(); const popup = useMemo(() => { - return maplibregl.Popup().setText('Hello world!'); + return new maplibregl.Popup().setText('Hello world!'); }, []) const togglePopup = useCallback(() => {