Back in February 2015, Tim Witt released a modified Coordinate widget that also shows current map scale. I took the scale-related elements of that widget and added them to the Esri Coordinate widget released with WAB Developer Edition 2.2.
Here's a screenshot of the widget working in an app made using WAB Dev 2.2. Note that this shot is from Firefox browser (it will appear this way in Chrome as well). If IE11 is used, the scale will appear on same line as lat/long coordinates.
To install, unzip and place "Coordinate" folder in the widget folder of your WAB Dev 2.2 app after deleting the stock Esri Coordinate widget:
WABdev_2.2\server\apps\#\widgets
I strongly recommend that you DO NOT replace the stock Esri Coordinate widget in the base widget folder (\WABdev_2.2\client\stemapp\widgets), as doing so will greatly complicate general app handling (e.g. duplicating, creating) and the importing of apps from earlier versions of WAB Dev.
Let me know if any problems arise, and I will attempt to fix them.
EDIT: This widget appears to also work for WAB Dev 2.3, 2.4, and 2.5.
Awesome! Thanks!
My defulat coordinate system is NAD 83 UTM 15 (metres). The scale works great with that. Displays exactly the scale levels i've set up with my cached services. When I add a second coordinate system to this coordinate widget (WKID: 3857 TFWKKID: 1188 Units: DD) the scale works fine when the default coordinate system is shown. However when I switch to the WGS system, no coordinates are shown, only scale and the scale spans across 2 lines. Switching back to default restores the coordinates and the scale.
Still, good enough for me for now. Great work!
added to the /blogs/myAlaskaGIS/2016/03/09/web-appbuilder-developer-edition-customization-resource-list?sr=search... ...better late than never (sorry I missed it)
Hello.
Coordinates don't change when moving the mouse, they change when panning.
Abraham,
That is by design when the maps WKID and the chosen WKID in the coordinate are not the same the widget will not update on a mouse move.
Hello Robert. I have this strange behavior. I have an app where the map in config.json is set to
"wkid": 102100
In the coordinates widget.js
is set to :
3857 : this.map.spatialReference.wkid;
The coordinate are shown when the mouse is moving.
In another app I have these identical settings but the coordinate is not updated when the mouse is moving.
Ideas?
Thanks.
Lefteris,
You do not have the coordinate widgets mouse click button activated do you? When you click on the crosshairs button next to the coordinate readout you set the widget to click mode.
No. When the app starts the coordinate is not updated when the mouse moves. I know about the click to activate the read the coordinate of the clicked location.
Strange. Can you attach your config_Cordinate.json file?
The json file of the widget is the same as the one you download. Haven't made any changes.
The config.json of the app is
"map": {
"3D": false,
"2D": true,
"position": {
"left": 0,
"top": 85,
"right": 0,
"bottom": 0
},
"itemId": "8bf7167d20924cbf8e25e7b11c7c502c",
"mapOptions": {
"showLabels": true,
"extent": {
"xmin": -14260088.866018897,
"ymin": 3333883.435196517,
"xmax": -12107622.149508907,
"ymax": 5310239.238537509,
"spatialReference": {
"wkid": 102100
}
}
},