esri scalebar srcNodeRef

763
2
Jump to solution
02-15-2013 03:07 AM
NigelAlford
New Contributor III
I'm unsure of how to use this property of the scalebar widget. If I pass the id with or without '#' as a string It does not attach to my div. Has anyone successfully used this, if so how?

var scalebar = new esri.dijit.Scalebar({                 map: map,                 srcNodeRef: "#scale",                 //attachTo: "bottom-right",                 scalebarUnit: "english"             });
0 Kudos
1 Solution

Accepted Solutions
NigelAlford
New Contributor III
Resolved:

I just used Jquery to append the ESRI class to my desired div. With a small css overwrite this worked fine:

$('#scale').append($('.esriScalebar'));

View solution in original post

0 Kudos
2 Replies
NigelAlford
New Contributor III
Resolved:

I just used Jquery to append the ESRI class to my desired div. With a small css overwrite this worked fine:

$('#scale').append($('.esriScalebar'));
0 Kudos
KellyHutchins
Esri Frequent Contributor
Hi Nigel,

The source node ref needs to be specified after the parameters. Here's an example:


        var scalebar = new esri.dijit.Scalebar({
            map: map,
            scalebarUnit: "english"
          }, dojo.byId("scalebar"));


0 Kudos