Coordinate + Scale widget for WAB Dev 2.2

3531
17
10-14-2016 09:58 AM
Labels (1)
BarnabyRockwell
Occasional Contributor III

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.

17 Replies
RobertScheitlin__GISP
MVP Emeritus

Nope, I asked for the config_Coordinate.json file not the main config.json

0 Kudos
LefterisKoumis
Occasional Contributor III

This is the same for both apps, the working and not working.

{
  "spatialReferences": [],
  "decimalPlaces": 3,
  "addSeparator": true
}
0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Lefteris,

 

   So based on that you have not configured the coordinate widget. Can you try and add another wkid like 4326 using the widgets settings UI and then test again.

0 Kudos
LefterisKoumis
Occasional Contributor III

It already had a wkid on the UI. I added the 4326. But the json is still blank!

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Are you checking the [install dir]\server\apps\[app#]\configs\config_Coordinate.json?

0 Kudos
LefterisKoumis
Occasional Contributor III

I guess I didn't pay much attention to details. After your last message, I checked in the config folder and there is no config_Coordinate.json file. Then, I noticed at the top of the page at the widget is for web appbuilder 2.2. I am using  2.1

I guess the new version creates the json file. Sorry, for wasting your time. Bit it's still bizarre why it works for some app and not for others when they are all developed under 2.1 and they have the same settings.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Even in 2.1 it will create a config_Coordinate.json in the config folder is you make settings changes in the ui and then save the app. But like you said it is strange that the one app is acting differently.


Keep in mind that all widgets, once their settings dialog has been changed and the app is saved then the config that the widget will use is no longer in the widgets folder.

0 Kudos
LefterisKoumis
Occasional Contributor III

Ok the config for the coordinate is created. The map's and the coordinate wkid is the same.

I still get the "Move mouse to get coordinates" and it doesn't change when I move the mouse. 

Here is the config_Coordinate.json. Thank you.

{
  "spatialReferences": [
    {
      "wkid": "3857",
      "label": "WGS_1984_Web_Mercator_Auxiliary_Sphere",
      "outputUnit": "DECIMAL_DEGREES",
      "transformationWkid": "",
      "transformationLabel": "",
      "transformForward": false,
      "options": {
        "sameSRWithMap": true,
        "isGeographicCS": false,
        "isGeographicUnit": true,
        "isProjectedCS": true,
        "isProjectUnit": false,
        "spheroidCS": 4326,
        "defaultUnit": "Meter",
        "unitRate": 1
      }
    }
  ],
  "decimalPlaces": 3,
  "addSeparator": true
}
0 Kudos