Select to view content in your preferred language

Trying to customize zooming feature using codes from zoom widget (Zoom Widget)

1491
1
05-13-2016 05:24 AM
SachinTiwari
Emerging Contributor

I am trying to customized the zoom widget, i.e. i have created my own zoom in/out template, and now i want to invoke the zooming functionalities, but when i looked into the codes for zoom widget(zoom.js) the code is refererring this.viewModel.zoomOut();, so just would like to know that, from where it will get the reference of this.viewModel , i didnot find anywhere, in my case it comes as "undefined". any clue/pointer on this.

Tags (1)
0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Emeritus

Sachin,

  The zoom widget has a viewModel property:

Zoom | API Reference | ArcGIS API for JavaScript 4.0 | viewModel

When you create the zoom widget the constructor looks like this:

var zoom = new Zoom({ view: view });

0 Kudos