Skip to content

Totalbug92/React-New-Window-with-Mapbox-GL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Had some troubles using Mapbox gl (javascript) with react-new-window, as the map was rendered on the original page and that caused a bunch of nasty errors. I solved this problem by using React-routing to have newWindow point to an url with the map component, instead of the map component being a child of newWindow. Then i used broadcastChannel API to send messages back and forth between the two windows.

Dependencies:

To test clone the project

npm install
npm start

This project was bootstrapped with Create React App.

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

npm run build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

About

React(CRA) using mapbox-gl in a seperat window using react-new-window

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •