Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map Type Cesium React Reconciler Error #1371

Closed
ki1ikina opened this issue Jan 5, 2017 · 3 comments
Closed

Map Type Cesium React Reconciler Error #1371

ki1ikina opened this issue Jan 5, 2017 · 3 comments

Comments

@ki1ikina
Copy link

ki1ikina commented Jan 5, 2017

We created a new MapStore2 project with the project creation script with the latest MapStore 2 code (726be96), and added the following lines to the index.html file:

<script src="MapStore2/web/client/libs/Cesium/Build/Cesium/Cesium.js"></script>
<link rel="stylesheet" href="MapStore2/web/client/libs/Cesium/Build/Cesium/Widgets/widgets.css" />

Then we changed this line of code in Main.jsx from:

const Main = (props) => <MapViewer plugins={props.plugins} params={{mapType: "leaflet"}}/>;

to:

const Main = (props) => <MapViewer plugins={props.plugins} params={{mapType: "cesium"}}/>;

And we now get the following error in the web browser console:

ReactReconciler.js:51 Uncaught (in promise) TypeError: Cannot read property '_currentElement' of null(…)

When switching mapType back to "leaflet" or even "openlayers" all works as expected. Why does a mapType of "cesium" not work?

@mbarto
Copy link
Contributor

mbarto commented Jan 9, 2017 via email

@ki1ikina
Copy link
Author

ki1ikina commented Jan 9, 2017

I modified my webpack.config.js like so:

new NormalModuleReplacementPlugin(/leaflet$/, path.join(__dirname, "MapStore2", "web", "client", "libs", "leaflet")),
new NormalModuleReplacementPlugin(/openlayers$/, path.join(__dirname, "MapStore2", "web", "client", "libs", "openlayers")),
new NormalModuleReplacementPlugin(/cesium$/, path.join(__dirname, "MapStore2", "web", "client", "libs", "cesium")),
new NormalModuleReplacementPlugin(/proj4$/, path.join(__dirname, "MapStore2", "web", "client", "libs", "proj4")),
new NoErrorsPlugin()

and
{
test: /\.jsx?$/,
exclude: /(ol\.js)$|(Cesium\.js)$/,
loader: "react-hot",
include: [path.join(__dirname, "js"), path.join(__dirname, "MapStore2", "web", "client")]
}, {
test: /\.jsx?$/,
exclude: /(ol\.js)$|(Cesium\.js)$/,
loader: "babel-loader",
include: [path.join(__dirname, "js"), path.join(__dirname, "MapStore2", "web", "client")]
}

and I still get the same result in the console (e.g. ReactReconciler.js:51)

I'm sure I'm missing something, but not sure what.

@ki1ikina
Copy link
Author

I pulled down the latest version of master (c95bab9) and I was able to successfully manually change between openlayers & cesium. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants