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

Loading with Webpack+Cesium #36

Open
AwkEng opened this issue Nov 17, 2017 · 2 comments
Open

Loading with Webpack+Cesium #36

AwkEng opened this issue Nov 17, 2017 · 2 comments

Comments

@AwkEng
Copy link

AwkEng commented Nov 17, 2017

I love this plugin. I have been using the standalone version with Cesium in a desktop application and it works great. I'm currently developing a web app which is built using Webpack (including Cesium). I can't quite figure out how to integrate this plugin or if it is possible.

Has anyone successfully loaded with Webpack?

@alberto-acevedo
Copy link
Owner

I think an npm package will solve the issue of loading with Webpack. The plugin needs to get converted into a npm package. I have no time to work on it. I'm looking for a volunteer to implement the package.

Thanks,

Alberto

@pkuwwt
Copy link

pkuwwt commented May 2, 2018

It is not very hard.

  1. npm install necessary modules: hammerjs, markdown-it, markdown-it-sanitizer, leaflet
  2. replace all cesium modules in define() to a single reference to cesium, and use variables to refer to these modules. (assume you can import cesium anywhere in the project)
  3. replace hammer to hammerjs in define()
  4. replace knockout-es5 to cesium/thirdparty/knockout-3.4.2.js in define() (I dont know Why knockout-es5 shipped with cesium lack so many features.)
  5. delete less file in define()
  6. use an index.js to import the viewercesiumnavigationmixin.js and require the styles/cesium-navigation.less file, and export default viewercesiumnavigationmixin.
  7. import the index.js (import the containing dir directly)

All we have to do is to figure out the module stuff, no need to change the code inside.

BTW, I compile the whole source tree of cesium in my project. If you import the dist of cesium, it may be different.

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

No branches or pull requests

3 participants