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

10287
29
06-01-2017 05:38 AM
Labels (1)
MarkYerington
Occasional Contributor III

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
Occasional Contributor III

Rich

Here is the 2.8 version. Make sure you are zoomed in to where you have feature templates available and one is selected before clicking add location.

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
RichBell
Occasional Contributor

First

Thank You!

We use this widget to place County Monuments once they are placed in the field.

I customized the widget a little to be more strait forward for our edit users.

What I did do is compare your widget to the 2.9 Smart Editor widget, thus added the Edit Layer to “Automatically Turn On” and included the ability to add both the Lat./Long and State Plane coordinates to the proper database field after the Monument was placed using the defined coordinate system.

Again Thank You so much!!

Rich

0 Kudos
MarkYerington
Occasional Contributor III

Sounds great Rich!

Another user had emailed me directly so I had looked into this a couple months back. There were just a few changes that I had to make because of esri changes. I think going forward esri has incorporated this functionality into the out of the box smart editor widget.

https://www.esri.com/arcgis-blog/products/web-appbuilder/water/using-the-smart-editor-widget-for-common-utility-workflows/

As you can see in the blog it states you can move point feature to GPS location. Not sure if you can create at XY, I have not looked into this new functionality from esri.

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
RichBell
Occasional Contributor

Mark

A while back you updated this widget to work with WAB 2.8.

I found a bug that I cannot fix. Please help me if you can. What I found is:

After the point is placed, then click update, the Lat/Long and Northing/Easting coordinate fields populate.

BUT when you hit save button the Northing and Easting values will disappear and not populate the data field.

Reason being is that the commas are NOT being placed.

If you manually place the commas before you click save every thing works.

I have tried to fix this for a week with no luck.

I need the commas to be place or some function to use the field without the commas.

The image below is what is produced without the commas for the Northing & Easting fields.

The Fields will not save without the commas being shown.

Help?

0 Kudos
MarkYerington
Occasional Contributor III

Rich

What is your database field type.  I would think it would have something to do with the database.  If you check your developer's console in chrome is there any error when you select Save?

0 Kudos
MarkYerington
Occasional Contributor III

Also when you hit the your update button you could add commas in to the text.

0 Kudos
RichBell
Occasional Contributor

The field type is DOUBLE.

What I think maybe needs to happen is that your code needs to place the graphic point using the commas.

Because the Smart Editor “Update function adds the commas in the field. Why??

Weird function because the data field is Double as does not allow characters. Why would ESRI do that?

I need to dumb the steps down with little human interaction, unfortunately I’m not the one who does the data input.

I’m sure you get the concept.

Thank again

0 Kudos
MarkYerington
Occasional Contributor III

So the update function is adding the commas and your field does not like it? I thought you were saying if you add commas it will accept the value, so I was thinking you need commas. I can look into it when I get some time, there has to be a setting that can be changed just like the coordinate widget, locator, etc where it defaults to adding a comma.

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
RichBell
Occasional Contributor

The “update” does add the commas, hit save and it works.

Your code places the graphic point without commas and will not save, it wipes the 2 fields clean.

Then you must select the graphic point again, Click update, and it adds the commas and will save the values.

I did notice somewhere in the widget code it said “to avoid saving twice”. Maybe that is where to look????

This is driving me nuts!

Rich

0 Kudos
ThomasColson
MVP Frequent Contributor

In your original post "If you just want it in an application add it into \server\apps\app#\widgets folder.", for the life of me, I cannot find the \server\apps\app#\widgets folder (yes I have an app#), or even the \server\apps\ folder?

0 Kudos