Advertisement
Guest User

Untitled

a guest
Feb 26th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. var viewer = new Cesium.Viewer('cesiumContainer');
  2. var scene = viewer.scene;
  3.  
  4. var instance = new Cesium.GeometryInstance({
  5. geometry : new Cesium.RectangleGeometry({
  6. rectangle : Cesium.Rectangle.fromDegrees(-130.0, 40.0, -115.0, 60.0),
  7. vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
  8. }),
  9. attributes : {
  10. color : new Cesium.ColorGeometryInstanceAttribute(0.0, 0.0, 1.0, 0.8)
  11. }
  12. });
  13.  
  14. viewer.entities.add({
  15. position : Cesium.Cartesian3.fromDegrees( -122.19, 46.1914),
  16. label : {
  17. text : 'Some Text',
  18. font : '24px Helvetica',
  19. fillColor : Cesium.Color.WHITE,
  20. outlineColor : Cesium.Color.BLACK,
  21. outlineWidth : 2,
  22. style : Cesium.LabelStyle.FILL_AND_OUTLINE
  23. }
  24. });
  25.  
  26. scene.primitives.add(new Cesium.Primitive({
  27. geometryInstances : [instance],
  28. appearance : new Cesium.PerInstanceColorAppearance()
  29. }));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement