{"id":13762977,"url":"https://github.com/openlayers/ol-cesium","last_synced_at":"2025-05-13T19:11:20.676Z","repository":{"id":18540910,"uuid":"21741875","full_name":"openlayers/ol-cesium","owner":"openlayers","description":"OpenLayers - Cesium integration","archived":false,"fork":false,"pushed_at":"2025-04-21T18:44:43.000Z","size":33790,"stargazers_count":1054,"open_issues_count":157,"forks_count":329,"subscribers_count":92,"default_branch":"master","last_synced_at":"2025-04-25T22:46:09.859Z","etag":null,"topics":["3d","cesium","openlayers"],"latest_commit_sha":null,"homepage":"http://openlayers.org/ol-cesium/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openlayers.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-07-11T15:45:47.000Z","updated_at":"2025-04-21T07:41:56.000Z","dependencies_parsed_at":"2023-01-13T19:53:14.864Z","dependency_job_id":"a4266140-7693-4040-8f37-46b2d15e3bfb","html_url":"https://github.com/openlayers/ol-cesium","commit_stats":{"total_commits":1297,"total_committers":48,"mean_commits":"27.020833333333332","dds":"0.46260601387818046","last_synced_commit":"d04c90a2a6e2fc14cc33e3b94b9d6a1351a80a6b"},"previous_names":["openlayers/ol3-cesium"],"tags_count":76,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openlayers%2Fol-cesium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openlayers%2Fol-cesium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openlayers%2Fol-cesium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openlayers%2Fol-cesium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openlayers","download_url":"https://codeload.github.com/openlayers/ol-cesium/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250907673,"owners_count":21506068,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d","cesium","openlayers"],"created_at":"2024-08-03T15:00:24.228Z","updated_at":"2025-04-25T22:46:17.103Z","avatar_url":"https://github.com/openlayers.png","language":"TypeScript","funding_links":[],"categories":["Uncategorized","Libraries \u0026 Plugins"],"sub_categories":["Uncategorized","Data Visualization"],"readme":"# OpenLayers - Cesium library\n\nOLCS is an opensource JS library for making [OpenLayers](https://openlayers.org/) and [CesiumJS](https://cesium.com/platform/cesiumjs/) works together, in the same application.\nIt addresses several use-cases:\n\n- [Adding 3D to an existing OpenLayers map](#Adding 3D to an existing OpenLayers map)\n- [Extending CesiumJS with new capabilities](#Extending CesiumJS with new capabilities)\n- [Cherry-picking the pieces you need](#Cherry-picking the pieces you need)\n\nSee [live examples](https://openlayers.org/ol-cesium/examples/).\n\nThe npm package is called [olcs](https://www.npmjs.com/package/olcs).\nNote that CesiumJS is accessed through the global `window.Cesium` object.\n\n## Features\n\nSwitch smoothly between 2D and 3D and synchronize:\n\n- Map context (bounding box and zoom level);\n- Raster data sources;\n- Vector data sources in 2D and 3D;\n- Map selection (selected items);\n- Animated transitions between map and globe view.\n\nThe library is configurable and extensible and allows:\n\n- Lazy or eager loading of Cesium\n- Limiting Cesium resource consumption (idle detection)\n\nFor synchronization of maps in projections other than EPSG:4326 and EPSG:3857 you need 2 datasets, see the customProj example.\n\n## Adding 3D to an existing OpenLayers map\n\n```js\n// Create an OpenLayers map or start from an existing one.\nimport Map from 'ol/Map.js';\nconst ol2dMap = new Map({\n    ...\n});\nol2dMap.addLayer(....)\n```\n\n```js\n// Pass the map to the OL-Cesium constructor\n// OL-Cesium will create and synchronize a 3D CesiumJs globe from your layers and data.\nimport OLCesium from 'olcs';\nconst ol3d = new OLCesium({map: ol2dMap});\n```\n\n```js\nol3d.setEnabled(true); // switch to 3D - show the globe\nol3d.setEnabled(false); // switch to 2D - show the map\n```\n\nBuild with your prefered bundler.\n\nYou can use any version of CesiumJS: latest upstream, a fork...\nSimply provide it as `window.Cesium` global:\n\n```html\n\u003cscript src=\"https://cesium.com/downloads/cesiumjs/releases/1.113/Build/Cesium/Cesium.js\"\u003e\u003c/script\u003e\n```\n\n## Extending CesiumJS with new capabilities\n\n```js\n// Start from a CesiumJS globe\nconst viewer = getYourCesiumJSViewer();\n\n// Add OpenLayers imagery provider\nimport {OLImageryProvider} from 'olcs';\nviewer.scene.imageryLayers.addImageryProvider(new OLImageryProvider(...));\n\n// Add Mapbox MVT imagery provider (client side rendering)\nimport {MVTImageryProvider} from 'olcs';\nviewer.scene.imageryLayers.addImageryProvider(new MVTImageryProvider(...));\n```\n\nThis is a bit limited at the moment but idea would be to implement:\n\n- client side reprojection;\n- full client side MVT rendering;\n- GeoTIFF rendering;\n- ... any feature available in OpenLayers.\n\n## Cherry-picking the pieces you need\n\nSpecific low level functionnalities can be cherry-picked from the library.\nFor example:\n\n```js\n// GoogleMap rotating effect\nimport {rotateAroundBottomCenter} from 'olcs';\nrotateAroundBottomCenter(viewer.scene, someAngle);\n```\n\n```ts\n// convert OpenLayers Vector Layer to CesiumJS primitives\nimport {FeatureConverter} from 'olcs';\nconst converter = new FeatureConverter(viewer.scene);\nconst featurePrimitiveMap: Record\u003cnumber, PrimitiveCollection\u003e = {};\nconst counterpart: VectorLayerCounterpart = this.converter.olVectorLayerToCesium(olLayer, view, featurePrimitiveMap);\nconst csPrimitives = counterpart.getRootPrimitive();\nviewer.scene.primitives.add(csPrimitives);\n```\n\n```js\n// Even more powerful, use a synchronizer\nimport {VectorSynchronizer} from 'olcs';\nconst synchronizer = new VectorSynchronizer(ol2dMtheap, viewer.scene);\n```\n\nIf you think some low level features should be spotlited here, open an issue and let's discuss it.\n\n## Configuration\n\nUse properties to control specific aspects of OL-Cesium integration, see the [PROPERTIES.MD](https://github.com/openlayers/ol-cesium/blob/master/PROPERTIES.md).\n\nAlso, check the [api doc](https://openlayers.org/ol-cesium/apidoc/).\n\n## Limitations due to OpenLayers\n\nThere are a few limitations due to decisions on\n\n- OpenLayers unmanaged layers are not discoverable and as a consequence not\nsupported. Plain layers should be used instead of the synchronization managed\nmanually. See https://github.com/openlayers/ol-cesium/issues/350.\n\n- OpenLayers interactions are not supported in 3d. See https://github.com/openlayers/ol-cesium/issues/655.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenlayers%2Fol-cesium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenlayers%2Fol-cesium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenlayers%2Fol-cesium/lists"}