Git Product home page Git Product logo

mapillary / mapillary-js Goto Github PK

View Code? Open in Web Editor NEW
436.0 436.0 83.0 59.4 MB

Interactive, extendable street imagery map experiences in the browser, powered by WebGL

Home Page: https://mapillary.github.io/mapillary-js

License: MIT License

JavaScript 0.21% CSS 1.32% TypeScript 98.45% Dockerfile 0.02%
3d computational-geometry geospatial imagery map-building mapillary renderer spatial-visualization street-imagery typescript viewer webgl

mapillary-js's Introduction

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.

ES6 bundler

Install the package via Yarn (or npm).

yarn add mapillary-js

Use a CSS loader or include the CSS file in the <head> of your HTML file.

<link
  href="https://unpkg.com/[email protected]/dist/mapillary.css"
  rel="stylesheet"
/>

Include the following code in your JavaScript file.

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>",
});
TypeScript

Install the package via Yarn (or npm).

yarn add mapillary-js

Use a CSS loader or include the CSS file in the <head> of your HTML file.

<link
  href="https://unpkg.com/[email protected]/dist/mapillary.css"
  rel="stylesheet"
/>

Include the following code in your TypeScript file.

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);
CDN

Include the JavaScript and CSS files in the <head> of your HTML file.

<script src="https://unpkg.com/[email protected]/dist/mapillary.js"></script>
<link
  href="https://unpkg.com/[email protected]/dist/mapillary.css"
  rel="stylesheet"
/>

Add a container to the <body> of your HTML file.

<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.

<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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.