Using drawExtent with CesiumViewerWidget

Hello,

Is it possible to use the drawExtent code with CesiumViewerWidget ?

When I try I get "Uncaught TypeError: undefined is not a function " on this line:

this._mouseHandler = new Cesium.ScreenSpaceEventHandler(this._canvas);

I notice the example actually uses CesiumWidget instead of CesiumViewerWidget, is that my problem?

Thanks a lot,

Mohamed.

Anybody using the drawExtent code with CesiumViewerWidget? Would appreciate any hints on how to make this work… this is all very new to me :slight_smile:

Thanks a lot,

Mohamed.

I replaced the CesiumWidget with the CesiumViewerWidget in the Sandcastle without a problem. Change the top of the example to:

require([

‘Cesium’, ‘Widgets/Dojo/CesiumViewerWidget’, ‘dijit/form/Button’

], function(

Cesium, CesiumViewerWidget, Button)

{

and where the widget is created, change the code to:

var widget = new CesiumViewerWidget();

If the ScreenSpaceEventHandler constructor function is undefined, make sure that the source is included.

Thaks Daniel.

I based my app off of one of the example of sandcasle… It start like what follows, would mind telling me what you think I am missing:

require({

baseUrl : ‘/Cesium-b13’,

packages: [

{ name: ‘dojo’, location: ‘ThirdParty/dojo-release-1.8.3-src/dojo’ },

{ name: ‘dijit’, location: ‘ThirdParty/dojo-release-1.8.3-src/dijit’ },

{ name: ‘dojox’, location: ‘ThirdParty/dojo-release-1.8.3-src/dojox’ },

{ name: ‘Assets’, location: ‘Source/Assets’ },

{ name: ‘Core’, location: ‘Source/Core’ },

{ name: ‘DynamicScene’, location: ‘Source/DynamicScene’ },

{ name: ‘Renderer’, location: ‘Source/Renderer’ },

{ name: ‘Scene’, location: ‘Source/Scene’ },

{ name: ‘Shaders’, location: ‘Source/Shaders’ },

{ name: ‘ThirdParty’, location: ‘Source/ThirdParty’ },

{ name: ‘Widgets’, location: ‘Source/Widgets’ },

{ name: ‘Workers’, location: ‘Source/Workers’ }

]

});

require([‘Source/Cesium’, ‘Widgets/Dojo/CesiumViewerWidget’, ‘dojo/on’, ‘dojo/dom’, ‘dojo/io-query’, ‘dijit/form/Button’, “dijit/Menu”, “dijit/MenuItem”, “dijit/form/ComboButton” ],

function( Cesium, CesiumViewerWidget, on, dom, ioQuery, Button, Menu, MenuItem, ComboButton ) {

“use strict”;