Measurement Widget and compact API

737
4
Jump to solution
07-19-2012 09:12 AM
DarellStoick
New Contributor III
I am trying to use the ...?v=3.0compact and the Measurement Widget.  It doesn't appear the compact version of the API has everything the widget requires but it should be possible to add the missing references with dojo.require(). 

Any one know which ones I need to add in order to get the Measurement widget to work?

thanks
0 Kudos
1 Solution

Accepted Solutions
MattLane
Occasional Contributor II
The measurement widget requires dojo.number.

View solution in original post

0 Kudos
4 Replies
MattLane
Occasional Contributor II
The measurement widget requires dojo.number.
0 Kudos
JianHuang
Occasional Contributor III
When you call dojo.require("esri.dijit.Measurement"), it should include all the required module automatically. So you don't have to call those requires again.
Just for your information, here is the list of the required.
dojo.require("dijit._Widget");
dojo.require("dijit._Templated");
dojo.require("esri.map");
dojo.require("esri.geometry");
dojo.require("esri.symbol");
dojo.require("dojo.parser");
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.Menu");
dojo.require("dijit.form.Button");
dojo.require("esri.tasks.geometry");
dojo.require("esri.WKIDUnitConversion");
0 Kudos
DarellStoick
New Contributor III
using the Resource Center sample under Widget ->Measurement 

If I replace
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.0"></script>
with
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.0compact"></script>

I get an error in the measurement.js script file when I use the Area or Distance tools.  Coordinates seems to work. Running with ...3.0 works fine.

I'll try to add the references you supplied and see if it works w/ compact
0 Kudos
DarellStoick
New Contributor III
Adding dojo.require("dojo.number"); is what I needed - Thanks
0 Kudos