In our examples, we try not to use the `goog` namespace (outside of `goog.require` calls which are stripped from hosted examples).  So instead of `goog.events.listen` use the `on` method from `ol.Observable`.

Also, instead of using the enumeration properties (e.g. `ol.DrawEventType.DRAWEND`), we use the enumeration values in examples (e.g. `'drawend'`).  So this would look like this:
```js
draw.on('drawstart, listener);
```

Same goes for other `goog.events.listen` calls in this example.