Sunday, 15 April 2012

Display of KML in Cesium -



Display of KML in Cesium -

i want display kml cesium.

the source kml can read looking next github. https://github.com/analyticalgraphicsinc/cesium/tree/kml

build , run cesium.

however, not know. how may specified in kml.

what should written after following? class="snippet-code-js lang-js prettyprint-override"> var viewer = new cesium.viewer('cesiumcontainer');

there few different ways load kml data, easiest passing url kml or kmz file read:

var kmldatasource = new cesium.kmldatasource(); kmldatasource.loadurl('path/to/kml/or/kmz'); viewer.datasources.add(kmldatasource);

you can't read local files way, path needs on server, if able drag & drop kml or kmz files app, can enable calling

viewer.extend(cesium.viewerdragdropmixin);

finally, 30 seconds ago added ability build kmldatasource , load url @ same time. if sync head of branch can in 1 line.

viewer.datasources.add(kmldatasource.fromurl('path/to/kml/or/kmz'));

cesium

No comments:

Post a Comment