mirror of
https://github.com/visgl/react-map-gl.git
synced 2026-01-18 15:54:22 +00:00
Examples running under ES6 Remove dist folder from git repo Support for React 14 in tests. Add envify to tests. Add props for bearing and pitch Ensure map.resize() happens after render() Added resize handling to examples Add CHANGELOG Ensure onChangeViewport is called on resize and with fresh projectionMatrix in onMouseRotate Specify a version range for react. Fix example overlay imports and remove map style batching per mapbox-gl 0.18 Updating mabox-gl to 0.20 Use tape-catch
34 lines
911 B
JavaScript
34 lines
911 B
JavaScript
import document from 'global/document';
|
|
/* global process */
|
|
import React from 'react';
|
|
import ReactDOM from 'react-dom';
|
|
import test from 'tape-catch';
|
|
import MapGL from '../src';
|
|
|
|
/* eslint-disable no-process-env */
|
|
// This will get converted to a string by envify
|
|
const mapboxApiAccessToken = process.env.MapboxAccessToken;
|
|
/* eslint-enable no-process-env */
|
|
|
|
/* eslint-disable func-names, no-shadow */
|
|
test('MapGL', function(t) {
|
|
t.test('Exists', function(t) {
|
|
t.ok(MapGL);
|
|
const map = (
|
|
<MapGL
|
|
width={ 500 }
|
|
height={ 500 }
|
|
longitude={ -122 }
|
|
latitude={ 37 }
|
|
zoom={ 14 }
|
|
mapboxApiAccessToken={ mapboxApiAccessToken }/>
|
|
);
|
|
const reactContainer = document.createElement('div');
|
|
document.body.appendChild(reactContainer);
|
|
ReactDOM.render(map, reactContainer);
|
|
t.ok(true);
|
|
t.end();
|
|
});
|
|
});
|
|
/* eslint-enable func-names */
|