Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mapbox/mapbox-gl-framerate

A frame rate control to evaluate map rendering performance
https://github.com/mapbox/mapbox-gl-framerate

Last synced: about 17 hours ago
JSON representation

A frame rate control to evaluate map rendering performance

Awesome Lists containing this project

README

        

mapbox-gl-framerate ([demo](https://labs.mapbox.com/mapbox-gl-framerate/))
---

A frame rate control to evaluate map rendering performance

### Usage

```js
const map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/light-v9'
});

const fps = new mapboxgl.FrameRateControl({ /* optional options */ });
map.addControl(fps);
```

### Options

| Property | Value | Description |
| ---- | ---- | ---- |
| background |

rgba(0,0,0,0.9)
| Color of the background container. |
| barWidth |
4 * window.devicePixelRatio
| Width of each individual performance bar. |
| color |
#7cf859
| Bar & text color. |
| font |
'Monaco, Consolas, Courier, monospace'
| Comma separated string of fonts for text. |
| graphHeight |
60 * window.devicePixelRatio
| Graph height. |
| graphWidth |
90 * window.devicePixelRatio
| Graph width. |
| graphTop |
0
| Top position of the graph. |
| graphRight |
5 * window.devicePixelRatio
| Right position of the graph. |
| width |
100 * window.devicePixelRatio
| Container width of the graph. |

### Running the demo

```sh
npm install & npm start & open http://localhost:1337/
```