Create Point Features at XY Location Version 2.4 - 05/31/17

11940
29
06-01-2017 05:38 AM
MarkYerington
Frequent Contributor

All

This widget is for creating point features at a known XY location.  It is extending the smart editor widget so you can select a feature template and enter the XY location of the point.  Once you click add location it will create the point at that known location.

I have a projection in my updates as some of our submittals are in decimal degrees WGS 84 and some are in State Plane.  All of our maps are in Iowa State Plane South so I need to reproject using the WGS 84 output Spatial Reference and use the correct Transformation.  If you are going to stay in the basemaps current coordinate system there is no need for a reprojection.  If you do need to reproject you will have to update the url to your geometry service and also update all of the WKIDs on line 223,228, and 229 in widget.js.

The widget layout looks like the following:

Setting up the Widget

To install the widget for all web app builder applications you can add the widget to \client\stemapp\widgets folder.  It will overwrite the default smart editor widget.  If you just want it in an application add it into \server\apps\app#\widgets folder.

0 Kudos
29 Replies
MarkYerington
Frequent Contributor

Are you starting with a new version of Webappbuilder? If so you may have to create your first app first before the server apps folder will show up. In the webappbuilder folder after download you should see the following:

Mark Yerington │GIS Manager│ GISP

Muscatine Area Geographic Information Consortium

c/o Muscatine Power & Water | 3205 Cedar Street | Muscatine, IA 52761

Office: 563.262.3316│Cell: 563.260.4525 Email: myerington@mpw.org│Web: magic-gis.com<https://magic-gis.com/>

0 Kudos
ThomasColson
MVP Frequent Contributor

I have created several dozen WAB apps, still a head scratcher where this folder is. What is the FULL path on a default installation?

0 Kudos
MarkYerington
Frequent Contributor

Tom

The default path on download does not contain an apps folder

Downloaded web app builder

Once you create an app there will be an apps folder in the server folder.  Each app has an app number.

Full Path to widget.js

Anything done in this folder only will only affect this app number 2

0 Kudos
ThomasColson
MVP Frequent Contributor

Ahhhh I see what you're doing....you're deploying your own WAB's.....

0 Kudos
ThomasColson
MVP Frequent Contributor

So with great difficulty and a renewed hatred of CORS settings, I got your 2.8 version of the widget deployed. Coupla questions though...

When I pick "Easting Northing", what coord system is that? Tried UTM 17 NAD 83, definitely not that. 

When the widget loads, I get a pick list CHOOSE COORDINATE INPUT TYPE

Once I pick a choice, I can't pick another one unless I reload the app. 

Great Widget, this will fill a hole until I can get on 10.7.1

0 Kudos
MarkYerington
Frequent Contributor

A quick answer to the first question is I am using Iowa State Plane South, so whatever your basemap is in if you want to translate to web Mercator WGS 84 (Lat / Long) you would have to use the correct transformation for that hard coded. Otherwise northing and easting is whatever coordinate your basemap is in currently. If you do not want to enter Lat and Long WGS 84 coordinates they will be placed as they should within the current coordinate system of the map.

The second question on the drop down I will have to test to see why yours may not be working correctly, I have never experienced that.

Mark Yerington │GIS Manager│ GISP

Muscatine Area Geographic Information Consortium

c/o Muscatine Power & Water | 3205 Cedar Street | Muscatine, IA 52761

Office: 563.262.3316│Cell: 563.260.4525 Email: myerington@mpw.org│Web: magic-gis.com<https://magic-gis.com/>

0 Kudos
ThomasColson
MVP Frequent Contributor

Yeah I kinda came to that conclusion. So using your projection(s), in the only projection that I know a web (base) map can be in, which is Web Mercator, where the Feature Service i'm editing against is GCS NAD 83, when I do:

The json sent to the server is 

https://domain.com/veg/rest/services/Utilities/Geometry/GeometryServer/project?f=json&outSR=3418&inS... 

Which returns error: {code: 500, message: "Error executing project", details: []}. 

I've tried a few different EPSG values in 

			 if (proj == "LATITUDE (Y) / LONGITUDE (X)" || leftlong == "-"){
				var inpoint = new esri.geometry.Point(randx,randy, new esri.SpatialReference(4326));
				gsvc = new esri.tasks.GeometryService("https://servername/arcgis/rest/services/Utilities/Geometry/GeometryServer");
				
				
				
				var outSR = new esri.SpatialReference(3418);
				var trans = 1188;

I'm just missing the boat on the RIGHT ones.....

0 Kudos
MarkYerington
Frequent Contributor

Don’t set to lat and long if your basemap is already in web Mercator. It will accept the lat and long as is by default. I built this tool to switch to lat and long because we have our own local basemaps in Iowa state plane south coordinate system so if we want to enter lat and long WGS84 coordinates we can; by switching and applying a transformation.

Mark Yerington │GIS Manager│ GISP

Muscatine Area Geographic Information Consortium

c/o Muscatine Power & Water | 3205 Cedar Street | Muscatine, IA 52761

Office: 563.262.3316│Cell: 563.260.4525 Email: myerington@mpw.org│Web: magic-gis.com<https://magic-gis.com/>

0 Kudos
KasimirOrlowski
Emerging Contributor

Dear Mark, 

I tried to use your widget as it could be super beneficial for my app. Unfortunately, always when I enter coordinates (e.g. 41, 35) it just creates a point at 0 ,0 . Do you know what the problem is? Thank you in advance!

0 Kudos
MichaelWalden1
Emerging Contributor

I tried to implement the SmartEditor widget by adding it as an Application Extension (AppBuilder) on my 10.7.1 Portal, but I get the following error:

"Invalid AppBuilder Extension. Verify that "wabVersion" is correctly defined."

I have other custom widgets (e.g. Elevation Profile, Popup Panel) that I have implemented like this, but for some reason this widget cannot be added.  I have tried updating the version in the manifest.json with no luck.  Any ideas? 

0 Kudos