You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Various documentation enhancements from the docs sprints:
* [docsprint] Clarify meaning of Map#isSourceLoaded (#9589)
* [docsprint] Add geolocate trigger example (#9552)
* [docsprint] Add inline snippet to marker#addTo (#9592)
* [docsprint] Add inline snippet and related examples to popup.setHTML (#9538)
* add inline snippet and related examples to popup.setHTML
* update see URLs to docs subdomain
* Add inline and related example for panTo (#9547)
* Add inline snippet to LngLatBounds.contains (#9548)
* [docsprint] Add inline snippet and examples to map.jumpTo (#9549)
* add inline snippet and examples to map.jumpTo
* minor reorder to match options and text
* added inline and tutorial examples for map.getCenter (#9551)
* add example for Marker class setLngLat (#9553)
* added examples to get- and setLayoutProperty (#9554)
* add inline snippet and examples to map.triggerRepaint (#9555)
* CameraOptions - update pitch and bearing definitions, add inline code example, add example links (#9556)
* add inline code snippet to map.showTileBoundaries (#9557)
* Mark Debug namespace as private to hide it from the docs (#9558)
* [docsprint] Add detail to docs on setFeatureState, removeFeatureState, getFeatureState (#9559)
* add detail to docs on setFeatureState, removeFeatureState, getFeatureState
* remove trailing spaces
* [docsprint] map.on: remove extra on section, link to event types, add code snippet, add related (#9560)
* add examples to open and close popup events (#9565)
* [docsprint] Clarify how map.moveLayer works (#9566)
* clarify how map.moveLayer works
* fix id capitalization
* [doscprint] add links to EPSG and minor example changes for LngLat (#9570)
* add links to EPSG and minor example changes for LngLat
* document the layer object's properties in addLayer (#9571)
* [docsprint] Add inline snippet and examples to popup.addTo (#9572)
* added inline example to popup-addto
* added relevant examples to popup.addto
* Add inline example for trackPointer (#9575)
* Add inline example for Popup#getElement (#9576)
* [docsprint] Add inline examples for Point & PointLike types (#9577)
* Add inline examples for Point & PointLike types
* Correct syntax
* [docsprint] Cleanup doc for MapBoxZoomEvent (#9564)
* Describe map style object returned by Map#getStyle (#9579)
* [docsprint] Add inline example for getClusterLeaves (#9580)
* [docsprint] PaddingOptions - update definition, example, and related (#9581)
* PaddingOptions - update definition, example, and related
* Fixes formatting issues
* [docsprint] Add inline snippet to marker#setPopup, marker#getPopup, and marker#togglePopup (#9582)
* update setPopup
* update togglePopup
* update formatting
* update setFilter jsdoc (#9586)
* add more details to getSource (#9587)
* add clearStorage example (#9588)
* [docsprint] Add documentation for RequestParameters (#9573)
* [docsprint] Add inline example for setZoomRate and setWheelZoomRate of scrollZoomHandler (#9593)
* Add inline example for setZoomRate of scrollZoomHandler
* add setWheelZoomRate inline example
* Add inline examples for map zoom-related methods (#9594)
* [docsprint] Add example to MapMouseEvent (#9595)
* add example to MapMouseEvent
* Add examples for GeolocateControl events (#9596)
* [docsprint] Add example to MapDataEvent (#9597)
* add example to MapDataEvent
* add example for getLngLat (#9591)
* suggested edits for clarifying mouse events
* Small grammar fix: "optional the `layerId`" -> "the optional `layerId"
* Update pitch param definition; add Display buildings in 3D example
* remove example object, light formatting and copyediting
Co-Authored-By: Dan Swick <dan.swick@gmail.com>
Co-authored-by: Adriana Babakanian <adriana.babakanian@mapbox.com>
Co-authored-by: Sam Fader <samfader@users.noreply.github.com>
Co-authored-by: Heather Stenson <heather.stenson@mapbox.com>
Co-authored-by: Katy DeCorah <decorah@mapbox.com>
Co-authored-by: jbranigan <john.branigan@mapbox.com>
Co-authored-by: Jeremy Stratman <jstratman@users.noreply.github.com>
Co-authored-by: Mal Wood-Santoro <mal.wood@mapbox.com>
Co-authored-by: Asheem Mamoowala <asheem.mamoowala@mapbox.com>
Co-authored-by: Colleen McGinnis <colleen.mcginnis@mapbox.com>
Co-authored-by: geografa <geografa@users.noreply.github.com>
Co-authored-by: Patrick Leonard <pjleonard37@users.noreply.github.com>
Co-authored-by: David Wicks <david.wicks@mapbox.com>
Co-authored-by: Deven Diliberto <deven.diliberto@mapbox.com>
Co-authored-by: Colleen <colleen.j.mcginnis@gmail.com>
Co-authored-by: Karim Naaji <karim.naaji@gmail.com>
Copy file name to clipboardexpand all lines: src/ui/camera.js
+78-7
Original file line number
Diff line number
Diff line change
@@ -33,11 +33,28 @@ import type {PaddingOptions} from '../geo/edge_insets';
33
33
* @typedef {Object} CameraOptions
34
34
* @property {LngLatLike} center The desired center.
35
35
* @property {number} zoom The desired zoom level.
36
-
* @property {number} bearing The desired bearing, in degrees. The bearing is the compass direction that
37
-
* is "up"; for example, a bearing of 90° orients the map so that east is up.
38
-
* @property {number} pitch The desired pitch, in degrees.
36
+
* @property {number} bearing The desired bearing in degrees. The bearing is the compass direction that
37
+
* is "up". For example, `bearing: 90` orients the map so that east is up.
38
+
* @property {number} pitch The desired pitch in degrees. The pitch is the angle towards the horizon
39
+
* measured in degrees with a range between 0 and 60 degrees. For example, pitch: 0 provides the appearance
40
+
* of looking straight down at the map, while pitch: 60 tilts the user's perspective towards the horizon.
41
+
* Increasing the pitch value is often used to display 3D objects.
39
42
* @property {LngLatLike} around If `zoom` is specified, `around` determines the point around which the zoom is centered.
40
43
* @property {PaddingOptions} padding Dimensions in pixels applied on each side of the viewport for shifting the vanishing point.
44
+
* @example
45
+
* // set the map's initial perspective with CameraOptions
46
+
* var map = new mapboxgl.Map({
47
+
* container: 'map',
48
+
* style: 'mapbox://styles/mapbox/streets-v11',
49
+
* center: [-73.5804, 45.53483],
50
+
* pitch: 60,
51
+
* bearing: -60,
52
+
* zoom: 10
53
+
* });
54
+
* @see [Set pitch and bearing](https://docs.mapbox.com/mapbox-gl-js/example/set-perspective/)
55
+
* @see [Jump to a series of locations](https://docs.mapbox.com/mapbox-gl-js/example/jump-to/)
56
+
* @see [Fly to a location](https://docs.mapbox.com/mapbox-gl-js/example/flyto/)
57
+
* @see [Display buildings in 3D](https://docs.mapbox.com/mapbox-gl-js/example/3d-buildings/)
41
58
*/
42
59
exporttypeCameraOptions={
43
60
center?: LngLatLike,
@@ -71,14 +88,28 @@ export type AnimationOptions = {
71
88
};
72
89
73
90
/**
74
-
* Options for setting padding on a call to {@link Map#fitBounds}. All properties of this object must be
91
+
* Options for setting padding on calls to methods such as {@link Map#fitBounds}, {@link Map#fitScreenCoordinates}, and {@link Map#setPadding}. Adjust these options to set the amount of padding in pixels added to the edges of the canvas. Set a uniform padding on all edges or individual values for each edge. All properties of this object must be
75
92
* non-negative integers.
76
93
*
77
94
* @typedef {Object} PaddingOptions
78
95
* @property {number} top Padding in pixels from the top of the map canvas.
79
96
* @property {number} bottom Padding in pixels from the bottom of the map canvas.
80
97
* @property {number} left Padding in pixels from the left of the map canvas.
81
98
* @property {number} right Padding in pixels from the right of the map canvas.
* @property {Position} data The returned [Position](https://developer.mozilla.org/en-US/docs/Web/API/Position) object from the callback in [Geolocation.getCurrentPosition()](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition) or [Geolocation.watchPosition()](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/watchPosition).
* @property {PositionError} data The returned [PositionError](https://developer.mozilla.org/en-US/docs/Web/API/PositionError) object from the callback in [Geolocation.getCurrentPosition()](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition) or [Geolocation.watchPosition()](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/watchPosition).
* @property {Position} data The returned [Position](https://developer.mozilla.org/en-US/docs/Web/API/Position) object from the callback in [Geolocation.getCurrentPosition()](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition) or [Geolocation.watchPosition()](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/watchPosition).
618
+
* @example
619
+
* // Initialize the geolocate control.
620
+
* var geolocate = new mapboxgl.GeolocateControl({
621
+
* positionOptions: {
622
+
* enableHighAccuracy: true
623
+
* },
624
+
* trackUserLocation: true
625
+
* });
626
+
* // Add the control to the map.
627
+
* map.addControl(geolocate);
628
+
* // Set an event listener that fires
629
+
* // when an outofmaxbounds event occurs.
630
+
* geolocate.on('outofmaxbounds', function() {
631
+
* console.log('An outofmaxbounds event has occurred.')
0 commit comments