OL-Cesium Design

39 views
Skip to first unread message

Eric Sherouse

unread,
Mar 1, 2018, 8:48:56 PM3/1/18
to OpenLayers Dev
Hello,

I've started digging in to ol-cesium while developing an Angular 5 application that uses openlayers and cesium. My assumption going in was that the ol-cesium project would be dependent on vanilla versions of openlayers and cesium and strictly export an 'ol-cesium' module that provides additional functionality on top of its dependent libraries. After looking over some of the source, it appears that ol-cesium actually bundles aspects of the openlayers project in with ol-cesium functionality and exports a custom ol module. If I am correct, I am curious about the motivation behind this decision instead of either keeping ol-cesium and openlayers distinct or pulling in the new functionality into mainline openlayers.

In the ideal case, I would like to be able to use ol-cesium along side my existing openlayers/cesium installations. If I had to downgrade/upgrade versions of either library, I would certainly understand. The necessity to use the custom exported ol module from ol-cesium means I need to refactor some of my application code because the closure compiler mangles the whole ol object, which I have already imported from openlayers.

Any thoughts on this would be much appreciated.

Thank you,
Eric

Guillaume Beraudo

unread,
Mar 2, 2018, 5:57:10 AM3/2/18
to OpenLayers Dev
Hi,

Cesium and OpenLayers dependencies are handled differently in OL-Cesium.
- Cesium dependency is external: each release is tested with a specific version but you can provide and use another one at runtime.
- OpenLayers dependency is compiled together: the result of the compilation contains OpenLayers and it is made available to applications through "window.ol".

This strategy has been the most simple (no externs generation) powerful (extend OpenLayers types, access internal code) and maintanable.

The javascript community is moving to ES6 modules and we are working on it.
If you are interested in an ES6 module support and you want to help, you can test the alpha-quality npm package at https://www.npmjs.com/package/olcs.

I will try to publish a new OL-Cesium version today and to update the package.


Regards,
Guillaume Beraudo

--
You received this message because you are subscribed to the Google Groups "OpenLayers Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openlayers-dev+unsubscribe@googlegroups.com.
To post to this group, send email to openlayers-dev@googlegroups.com.
Visit this group at https://groups.google.com/group/openlayers-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/openlayers-dev/84bd7b06-3a34-480b-a9ed-271af46da9f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages