Measurement Widget Code

805
9
Jump to solution
03-18-2014 04:50 AM
PaulHuppé
Occasional Contributor
Hi,

We need to make a lot of modifications to the widget to suit our needs, and I was wondering if instead of starting from scratch we get the code for the widget and modify it.

Paul
0 Kudos
1 Solution

Accepted Solutions
BenFousek
Occasional Contributor III
Starting from scratch isn't that bad. The thing with the esri widget, it has to take into effect every possible use and and isn't very customizable. With your own widget you have control over the look, feel and functionality. My widget is only a couple hundred lines long + a simple template. In the time spent trying to make the esri widget do what you want you could have your own. It's super easy if you use web mercator or lat/lng as you can use esri/geometry/geodesicUtils to compute accurate results in any unit w/o using a geom service.

View solution in original post

0 Kudos
9 Replies
MichaelVolz
Esteemed Contributor
Where would someone find the widget that you want to modify?
0 Kudos
PaulHuppé
Occasional Contributor
This widget is a standard ESRI dijit widget.
0 Kudos
TimWitt
Frequent Contributor
Maybe you could find the code here? https://github.com/Esri
0 Kudos
PaulHuppé
Occasional Contributor
Hi Tim,

Lots of stuff there, but they are all addons or custom things. No custom measurement tool.

Paul
0 Kudos
MichaelVolz
Esteemed Contributor
Paul:

I am a beginner with the Javascript API, so I have no idea where to find a standard ESRI dijit widget.  Can you help me with that?
0 Kudos
PaulHuppé
Occasional Contributor
You can find all the available widgets in the API documentation at https://developers.arcgis.com/javascript/jsapi/

L
ook under "esri" and "dijit" on that page for all widgets.
0 Kudos
JeffPace
MVP Alum
if you are looking for the source, non-obfuscated code, its not available.  You have to work with the api provided, extend it, or write your own
0 Kudos
BenFousek
Occasional Contributor III
Starting from scratch isn't that bad. The thing with the esri widget, it has to take into effect every possible use and and isn't very customizable. With your own widget you have control over the look, feel and functionality. My widget is only a couple hundred lines long + a simple template. In the time spent trying to make the esri widget do what you want you could have your own. It's super easy if you use web mercator or lat/lng as you can use esri/geometry/geodesicUtils to compute accurate results in any unit w/o using a geom service.
0 Kudos
PaulHuppé
Occasional Contributor
Ok, thanks everyone. Looks like we will write our own widget.
Paul
0 Kudos