Importing a JS library (Leaflet.js)


I would like to know if it is possible to import a JS library into CocosCreator in general. And afterwards if you make your build to android if it would work as expected.

More specific my question would also be, if the library “Leaflet.js” ( can be imported into CC 3.0 ?

Yes, the JS library importing is supported in CC 3.0
As for the Leaflet.js library, I’m not quite sure.
It seems that Leaflet.js is a web based library that can’t work on native Android platform

The native environment doesn’t use browser, so you won’t be able to access to DOM apis, but pure JS library will work just fine.

If it’s DOM dependent, you should find an alternative on native platform. Otherwise, please refer to the document

Ah okay. All this information helps me a lot. Thank you. I will investigate further into this. Maybe i can find a “pure” js library for my needs …

is there a kind of possibility with “webView” ? Is CC3.0 able to start a webview ? Thinking of using DOM with the webview-method.