ygorth

TypeError: Object #<Object> has no method 'disableDoubleClickZoom'.

Discussion created by ygorth on Jun 20, 2013
Hello guys,

My mission as a newbie ArcGIS JS developer continues. I created this class:

// NavigationToolBar.js

define([
        "dojo/_base/declare",
        "dojo/_base/connect",
        "dijit/registry",
        "dijit/form/Button",
        "esri/toolbars/navigation",
        "dojo/domReady!"],
  function (declare, connect, registry, Button, Navigation) {
      return declare([], {

          declaredClass: "modules.NavigationToolBar",

          // lifecycle: 1
          constructor: function (map) {
              
              var navToolbar = new Navigation(map);

              var buttonZoomin = new Button({
                  iconClass: 'zoominIcon',
                  onClick: function () {
                      navToolbar.activate(esri.toolbars.Navigation.ZOOM_IN);
                  }
              }, "zoomin");

          }

      });
  }
);


// main.js
require([
        "dojo/_base/connect",
        "esri/map",
        "esri/dijit/BasemapGallery",
        "modules/MapConfig",
        "modules/NavigationToolBar",
        "dojo/domReady!"],
    function (
        connect,
        Map,
        BasemapGallery,
        MapConfig,
        NavigationToolBar
        ) {

        // Crée et configure la Carte Interactive.
        var map = new Map("map", {
            basemap: "streets",
            logo: false,
            sliderStyle: "large",
            showAttribution: false
        });

        var navigationToolBar = new NavigationToolBar({
            map: map
        });
....


    <div id="topNavBar" data-dojo-type="dijit/Toolbar">
        <button id="zoomin" type="button">
        </button>
...


When I click on the ZOOM button I get the following error: Uncaught TypeError: Object # has no method <Object> 'disableDoubleClickZoom'. I think the problem is how I'm working with the object navToolbar.

Ty!

Outcomes