包详细信息

mapillary-js

mapillary13.5kMIT4.1.2

A WebGL interactive street imagery library

3d, computational-geometry, geospatial, imagery

自述文件

GitHub workflow GitHub license npm version

MapillaryJS

MapillaryJS is a client-side JavaScript library for interactive, extendable street imagery map experiences on the web. It takes spatial, semantic, and texture data and renders it using WebGL. MapillaryJS can be customized with camera controls, user interactivity, and data providers and it can be augmented with geospatial rendering, animation, and content placement.

Mapillary

Installation and Usage

To start using MapillaryJS with data from the Mapillary platform, you need an account. When signed in, you need to register an application to get a client access token. When providing your own data, no access token is needed.

<summary>ES6 bundler</summary> Install the package via Yarn (or npm). sh yarn add mapillary-js Use a CSS loader or include the CSS file in the <head> of your HTML file. html <link href="https://unpkg.com/mapillary-js@4.1.2/dist/mapillary.css" rel="stylesheet" /> Include the following code in your JavaScript file. js import { Viewer } from "mapillary-js"; const viewer = new Viewer({ accessToken: "<your access token>", container: "<your HTML element ID>", imageId: "<your image ID for initializing the viewer>", });
<summary>TypeScript</summary> Install the package via Yarn (or npm). sh yarn add mapillary-js Use a CSS loader or include the CSS file in the <head> of your HTML file. html <link href="https://unpkg.com/mapillary-js@4.1.2/dist/mapillary.css" rel="stylesheet" /> Include the following code in your TypeScript file. ts import { Viewer, ViewerOptions } from "mapillary-js"; const options: ViewerOptions = { accessToken: "<your access token>", container: "<your HTML element ID>", imageId: "<your image ID for initializing the viewer>", }; const viewer = new Viewer(options);
<summary>CDN</summary> Include the JavaScript and CSS files in the <head> of your HTML file. html <script src="https://unpkg.com/mapillary-js@4.1.2/dist/mapillary.js"></script> <link href="https://unpkg.com/mapillary-js@4.1.2/dist/mapillary.css" rel="stylesheet" /> Add a container to the <body> of your HTML file. html <div id="mly" style="width: 400px; height: 300px;"></div> The global UMD name for MapillaryJS is mapillary. Include the following script in the <body> of your HTML file. js <script> var { Viewer } = mapillary; var viewer = new Viewer({ accessToken: "<your access token>", container: "mly", imageId: "<your image ID for initializing the viewer>", }); </script>

Documentation

Code of Conduct

Facebook has adopted the Contributor Covenant as its Code of Conduct, and we expect project participants to adhere to it. Please read the full text so that you can understand what actions will and will not be tolerated.

License

MapillaryJS is MIT licensed.

更新日志

Changelog

All notable changes to MapillaryJS from v3.x will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

4.1.2 - November 15, 2023

:bug: Fixed

  • Request user (creator) from Graph API (5c86f4f)

4.1.1 - September 7, 2022

:bug: Fixed

  • Request organization (owner) from Graph API (5017e60)

4.1.0 - March 2, 2022

:rocket: New Features

  • Viewer method and event to get topocentric reference (#475)
  • Add provider interfaces to APT to not require providers to extend base classes (#477)
  • Flow declarations included in distribution (#478)
  • Add geodetic conversion methods to exported API (#484)
  • Point visualization mode enumeration (#486)
  • Cluster point visualization mode (#486)
  • Expose data provider as a viewer property (#502)
  • Add viewer method to check if camera controls are attached (#503)

:bug: Fixed

  • Detach custom camera controls correctly (#474)
  • Guard against bleeding CSS line height values (#499)
  • Move spatial component items instead of disposing on reference change to avoid race conditions (#504)
  • Render spatial component items correctly on activation (#508)

:nail_care: Improvements

  • Render spherical camera frames to avoid large star shapes for fisheye models (#464)
  • Smooth transition when entering earth state (#501)

:memo: Documentation

  • Add custom renderer example for synchronizing content pose between viewer and map (#452)
  • Fix JSDoc typos (#458)
  • Add viewer control and component guides (#465)
  • Improve wording in readme and try documentation, fix readme commands (#465)
  • Fix WebGL and editor examples (#467)
  • Add guide to write custom renderers for graphics developers (#483)
  • Add relevant phrases to glossary (#485)
  • Fix setup command example in contribution documention (#496)
  • Clarify how custom renderers should use onRemove method (#517)

:house: Internal

  • Update dependencies (#457)
  • Allow IDs of type number in cover component (#446)
  • Build library and documentation in different action jobs (#450)

4.0.0 - June 8, 2021

:rocket: New Features

  • Add ES6 module build to distribution (#341)
  • Add TypeScript type definitions to distribution (#341)
  • Add custom render API for augmented experiences (#336)
  • Custom camera controls API to freely move the Viewer camera (#373)
  • Emit load event on initial Viewer load (#376)
  • Add data provider event functionality ((#364)
  • Viewer option to deactivate image tiling (#352)

:boom: Breaking

  • Track resize internally by default (#353)
  • Rename JavaScript and CSS distribution files (#341)
  • Change global UMD name (#355)
  • Rewrite data provider API (#345)
  • Replace default data provider (#435)
  • Consolidate geometry provider API (#357)
  • Consolidate public API - no namespacing (#367)
  • Rename mouse to pointer component (#414)
  • Rename latLon to lngLat (#363)
  • Rename node to image (#361)
  • Remove route, background, and debug components (#344)
  • Remove cropped spherical camera type support (#344)
  • Remove node panorama properties (#344)

:bug: Fixed

  • Remove event listeners correctly (#430)
  • Render spatial items directly on activation (#390)
  • Render spherical images with non-valid scale correctly (#378)
  • Throw understandable errors in graph (#368)
  • Handle mouse up not fired outside of window for right mouse button (#342)
  • Handle fisheye origin singularity (#339)
  • Filter spatial data (#338)
  • Fix earth controls in Firefox on Mac (#333)
  • Allow different image tiling configs for multiple viewers in the same app (#441)

:nail_care: Improvements

  • Request image tiles immediately on halt (#375)
  • Position earth state based on initial pose (#398)
  • Request image tiles for low level (#386)
  • Improve spatial performance with logarithmic raycasting though octree (#377)
  • Typed event handlers (#360)
  • Unified component event structure (#347)
  • Decrease minified library disribution size from 1.8Mb to 1.1Mb (#341)
  • Right button drag to orbit in earth mode (#334)

:memo: Documentation

  • Simplity readme text, examples, and improve image (395)
  • Docusaurus documentation website - guides, API reference, examples, theory, migration, search (#396)

:house: Internal

  • Build distribution with Rollup (#341)
  • Unit test with Jest (#341)
  • Script to setup developnent environment access tokens (412)
  • Publish relevant files only (#356)
  • Move configuration files to separate directly (#354)
  • Prefix all style classes with mapillary (#343)

3.1.0 - January 20, 2021

:rocket: New Features

  • Remove method on Viewer for releasing resources (#321)
  • Add GeoCoords class to API (#322)
  • Add original altitude property to Node and IFillNode (#326)
  • Spatial camera and point resize options (#319)
  • Spatial option for orginal altitude (#326)
  • Spatial mouse interaction (#319)
  • Comply with filter in spatial component (#324)

:nail_care: Improvements

  • Disable play functionality in earth mode (#320)

:memo: Documentation

  • Fix examples of viewer creation (#318)
  • Remove obsolete move close to example (#323)

:house: Internal

  • Add docker development option and instruction (#325)

3.0.0 - December 12, 2020

:rocket: New Features

  • Add qualityScore property on Node
  • Data provider API to enable loading data from any source

:boom: Breaking

  • Change Viewer constructor to take only an options struct as parameter
  • Remove Viewer class moveCloseTo method
  • Rename Viewer class setAuthToken method to setUserToken
  • Rename Node class cameraProjection property to cameraProjectionType
  • Remove StatsComponent
  • Remove LoadingComponent
  • Move IUrlOptions properties to IFalcorDataProviderOptions

:memo: Documentation

  • Add data provider info to documentation
  • Restructure readme information
  • Add GitHub specific content
  • Add changelog

:house: Internal

  • Rename Container class element property to container
  • Use GitHub actions for continuous integration
  • Use Yarn for development