Skip to content

Commit

Permalink
add example for getLngLat (#9591)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpdiliberto authored Apr 20, 2020
1 parent b0623b8 commit a55e8e8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ui/marker.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,13 @@ export default class Marker extends Evented {
* the marker on screen.
*
* @returns {LngLat} A {@link LngLat} describing the marker's location.
*/
* @example
* // Store the marker's longitude and latitude coordinates in a variable
* var lngLat = marker.getLngLat();
* // Print the marker's longitude and latitude values in the console
* console.log('Longitude: ' + lngLat.lng + ', Latitude: ' + lngLat.lat )
* @see [Create a draggable Marker](https://docs.mapbox.com/mapbox-gl-js/example/drag-a-marker/)
*/
getLngLat() {
return this._lngLat;
}
Expand Down

0 comments on commit a55e8e8

Please sign in to comment.