├── public
├── favicon.ico
└── index.html
├── src
├── index.js
└── App.js
├── .gitignore
├── package.json
└── README.md
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stereobooster/create-react-app-map-gl/master/public/favicon.ico
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import App from './App';
4 |
5 | ReactDOM.render(
6 | ,
7 | document.getElementById('root')
8 | );
9 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 |
6 | # testing
7 | /coverage
8 |
9 | # production
10 | /build
11 |
12 | # misc
13 | .DS_Store
14 | .env
15 | npm-debug.log*
16 | yarn-debug.log*
17 | yarn-error.log*
18 |
19 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-map-gl-test1",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "mapbox-gl": "^0.36.0",
7 | "react": "^15.5.4",
8 | "react-dom": "^15.5.4",
9 | "react-map-gl": "https://github.com/uber/react-map-gl.git"
10 | },
11 | "devDependencies": {
12 | "react-scripts": "0.9.5"
13 | },
14 | "scripts": {
15 | "start": "react-scripts start",
16 | "build": "react-scripts build",
17 | "test": "react-scripts test --env=jsdom",
18 | "eject": "react-scripts eject"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Webpack 1, react-map-gl 3 git
2 |
3 | To reproduce bug
4 |
5 | ```
6 | yarn install
7 | cd node_modules/react-map-gl/
8 | yarn install
9 | npm run build-es5
10 | npm run postinstall
11 | cd ../..
12 | yarn start
13 | ```
14 |
15 | Error message:
16 |
17 | ```
18 | bootstrap a569c78…:555 Uncaught SyntaxError: Identifier 'Buffer' has already been declared
19 | at __webpack_require__ (bootstrap a569c78…:555)
20 | at fn (bootstrap a569c78…:86)
21 | at Object. (buffer_group.js:4)
22 | at __webpack_require__ (bootstrap a569c78…:555)
23 | at fn (bootstrap a569c78…:86)
24 | at Object. (bucket.js:4)
25 | at __webpack_require__ (bootstrap a569c78…:555)
26 | at fn (bootstrap a569c78…:86)
27 | at Object. (circle_bucket.js:3)
28 | at __webpack_require__ (bootstrap a569c78…:555)
29 | ```
30 |
--------------------------------------------------------------------------------
/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | // import mapboxgl from 'mapbox-gl/dist/mapbox-gl-dev';
3 |
4 | // do not use import MapGL from 'react-map-gl/dist-es6/index.js'
5 | // because this is Webpack 1
6 | import MapGL from 'react-map-gl'
7 |
8 | // import MapGL from 'react-map-gl/src/index.js'
9 | // import MapGL from 'mapbox-gl/dist/mapbox-gl';
10 | // import { default as Marker } from './components/Marker';
11 |
12 | //
16 |
17 | // {
24 | // // const {latitude, longitude, zoom} = viewport;
25 | // // Optionally call `setState` and use the state to update the map.
26 | // }}
27 | // >
28 | //
29 |
30 | class App extends Component {
31 | render() {
32 | return (
33 | hello world
34 | );
35 | }
36 | }
37 |
38 | export default App;
39 |
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
16 | React App
17 |
18 |
19 |
20 |
30 |
31 |
32 |
--------------------------------------------------------------------------------