MassGIS / morisoliver

Automatically exported from code.google.com/p/morisoliver
2 stars 2 forks source link

Add ability to edit attributes without editing shapes #207

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently editing always allows the editing of both shape and attributes.  It 
would be useful in a case where attributes only need to be edited to query for 
attribute data and allow editing of the attribute data only. This tool would be 
configured for one datalayer and would allow the user to select a feature by 
clicking on it, then the attribute table would appear.  The WFS query that 
selects the attributes would not select the shape.  The WFS Update statement 
would only update attributes.  One example would be to allow  a user to edit 
parcels (which can have many vertices) so that the user could select a parcel 
and edit an attribute indicating the type of landuse. 

Original issue reported on code.google.com by Aleda.Fr...@state.ma.us on 22 Apr 2013 at 1:05

GoogleCodeExporter commented 9 years ago
This corresponds to Task Order 5 enhancement 5

Original comment by Aleda.Fr...@state.ma.us on 22 Apr 2013 at 1:05

GoogleCodeExporter commented 9 years ago

Original comment by Aleda.Fr...@state.ma.us on 22 Apr 2013 at 1:08

GoogleCodeExporter commented 9 years ago

Original comment by Aleda.Fr...@state.ma.us on 22 Apr 2013 at 1:09

GoogleCodeExporter commented 9 years ago

Original comment by Aleda.Fr...@state.ma.us on 22 Apr 2013 at 1:09

GoogleCodeExporter commented 9 years ago
Aleda, I have never really used the editing tool.  Is there a sample working 
toolconfig you could send my way to get me started?

Original comment by cpl...@gmail.com on 6 May 2013 at 12:16

GoogleCodeExporter commented 9 years ago
I found something to work w/.

See r463.

toolSettings.editTool.layers needs to have a new attr called allowGeomEdit.

I wasn't sure if you wanted this entire enhancement to be a new button or if 
you wanted on a layer-by-layer basis.  Right now it's on a layer-by-layer 
basis.  I know that you requested that the feature NOT be highlighted, but 
having this visual cue was helpful IMHO, and keeping this capability also 
reduced the amount of code that needed to be changed.  So no new button.

I did notice several javascript errors go by even before I started working.  
I'm not sure if that's something that I have setup wrong here or if that's from 
OL 2.13 or if it's something that's always been there.

Original comment by cpl...@gmail.com on 8 May 2013 at 3:26

GoogleCodeExporter commented 9 years ago
I'm doing a little bookkeeping . . . have you had a chance to test this one yet?

Original comment by cpl...@gmail.com on 16 May 2013 at 3:57

GoogleCodeExporter commented 9 years ago
Not yet, I wanted to try to get the abutters (bufferidentify) tool in front of 
Neil' eyes first.  I'll try to test this today... 

Original comment by Aleda.Fr...@state.ma.us on 16 May 2013 at 3:58

GoogleCodeExporter commented 9 years ago
OK, I have been testing.  This stuff is complicated, I'm trying to make sure 
I've set everything up correctly. 

First, it does basically work.  
If I set a layer as allowGeomEdit : false  it won't allow me to move the 
vertices.
It's layer by layer.  
I tried in FF, IE, Chrome and Safari - all working 
I tried with points, lines, polys - all working 

I have a few issues and lots more to test.

Issue 1:  See 
http://maps.massgis.state.ma.us/map_ol_to5/oliver_editing_demo.php 
When I choose to draw or edit and I get the drop-up menu the little blue dot to 
indicate the active layer doesn't stay.  I saw this in FF and IE, didn't look 
in the others but I assume it's an issue there too.  This might have something 
to do with the ExtJs upgrade?

Issue 2:  The geometry is still being requested.  OK, so part of the point of 
this enhancement was to stop people from editing geometry, to simplify their 
UI.  Another part was to keep the browser from being overwhelmed if we tried to 
edit attributes on features that have complicated geometry (polys with 
thousands of vertices for example).  Now, maybe you're getting the geometry in 
the response but you're not loading it which would still solve this.  Do you 
know the answer?  I really need to set up a complicated geometry layer to edit 
(such as parcels) and test it.

I also need to try this new enhancement with HTTPS.
I also need to try this new enhancement with snapping and splitting. 
Just to make sure it doesn't conflict in some way. 

Original comment by Aleda.Fr...@state.ma.us on 21 May 2013 at 3:46

GoogleCodeExporter commented 9 years ago
For testing HTTPS I have set up a different .php and folderset and toolConfig...

https://maps.massgis.state.ma.us/map_ol_to5/oliver_editing_demo_https.php

Inside the .php I have to use https and wsgw.mass.gov instead of 
giswebservices.massgis.state.ma.us 

In any event, not getting a dropup menu for draw or edit - instead I get an 
error:

TypeError: editManager.editMenuButton.menu.items is undefined

Ext.each(editManager.editMenuButton.menu.items.items, function(item, idx) {

WFSTFe...ager.js (line 345)

Is this a misconfiguration on my part or a bug?  I can't tell... 

Original comment by Aleda.Fr...@state.ma.us on 21 May 2013 at 4:03

GoogleCodeExporter commented 9 years ago
Related to #10 HTTPS - if I keep clicking draw or edit I get this next error:

ReferenceError: dummyMenuItem is not defined

dummyMenuItem.setChecked(true);

WFSTFe...ager.js (line 348)

Original comment by Aleda.Fr...@state.ma.us on 21 May 2013 at 4:03

GoogleCodeExporter commented 9 years ago
Re. issue 1.  I didn't make any intentional changes to this part of the 
workflow.  Does it work differently from how a production editing demo works?  
If so, could you share a production editing demo link?

Re. issue 2.  I don't know if it makes sense not to d/l the geometry.  If the 
geom didn't come across the wire, it wouldn't know where to draw the feature(s) 
for you to click on to edit.  Also, if the geom weren't downloaded, I believe 
GeoExt wouldn't be very happy.  Looking at the spec to make sure I didn't miss 
anything, it only states that the would not be editable, not that it wouldn't 
come across the wire.  Or am I misunderstanding your issue or the intended 
workflow?

Original comment by cpl...@gmail.com on 21 May 2013 at 4:04

GoogleCodeExporter commented 9 years ago
I think is would help to compare apples & apples. For the tests that you've 
spun up here, could there be an identical companion production test URL?

Original comment by cpl...@gmail.com on 21 May 2013 at 4:06

GoogleCodeExporter commented 9 years ago
Re. issue 2.  Of course, how could you draw it... at least you won't have to 
update it or "highlight" the vertices if I say no geom editing.  I'll just have 
to try it. 

Original comment by Aleda.Fr...@state.ma.us on 21 May 2013 at 4:07

GoogleCodeExporter commented 9 years ago
Yes, we'll have to compare apples and apples.  
I'll need a little time to set things up... 

Original comment by Aleda.Fr...@state.ma.us on 21 May 2013 at 4:08

GoogleCodeExporter commented 9 years ago
OK, Re. issue 1.
I have a working http://maps.massgis.state.ma.us/map_ol/oliver_editing_demo.php
It also does not highlight with a blue dot the active layer.
If I go back another version it used to 
http://maps.massgis.state.ma.us/map_ol_bak_12_05_2012/oliver_editing_demo.php 
but I'm not going to worry about it because it's very unimportant and it could 
be a side effect of having fixed something else in the last round. So this is 
just a note so I can remember in the future.

Original comment by Aleda.Fr...@state.ma.us on 21 May 2013 at 5:36

GoogleCodeExporter commented 9 years ago
I now have apples to apples with HTTPS test as well.

https://maps.massgis.state.ma.us/map_ol/oliver_editing_demo_https.php
https://maps.massgis.state.ma.us/map_ol_to5/oliver_editing_demo_https.php

Everything works, I had a misconfiguration before.

So there are no issues for you at this time.  I'll test with snapping next and 
a layer with lots of vertices to make sure it keeps working.

Original comment by Aleda.Fr...@state.ma.us on 21 May 2013 at 6:09

GoogleCodeExporter commented 9 years ago
I'm breathing a sigh of relief here.  I want to stay out of the feature weeds 
if possible.

I'm also breathing a sigh of gratitude for the effort on your part required to 
setup a production test case alongside this development version.

Thank you!

Original comment by cpl...@gmail.com on 21 May 2013 at 6:13

GoogleCodeExporter commented 9 years ago
It was a stumble on my part really, I should test everything every time we make 
a change, but I didn't update some of my "demo" viewers before.  I feel better 
now that some of them are back.  

Original comment by Aleda.Fr...@state.ma.us on 21 May 2013 at 6:14

GoogleCodeExporter commented 9 years ago
notes to myself:
snapping is fine, for both new and existing features
my sample scr_new_bedford.php is fine.

Original comment by Aleda.Fr...@state.ma.us on 21 May 2013 at 7:33

GoogleCodeExporter commented 9 years ago
OK, I'm going to verify this because it does do what we asked for. 

I think something fancier might be in order in the future, but it would require 
quite a rethink of editing.  Currently layers to be edited are completed loaded 
_on startup_.  So I have a sample viewer 
(http://maps.massgis.state.ma.us/map_ol_to5/oliver_editing_demo_l3parcels.php) 
that has a layer of parcels for only one town - Medford - and it crashes FF and 
stalls IE on startup.  I was thinking that it might be nice to be able to edit 
attributes of features without loading vertices.  The way to do that would be 
to "draw" the data by drawing a cached tileset of the data - which we have for 
parcels.  Then, when the user where to draw a box on the map a WFS query would 
pull _just the attributes_ of _just those few features_ down and they could be 
edited.  Or possibly the shapes because for a small area it's probably OK even 
if the shapes are large.  Anyway, a conversation for the future.

Original comment by Aleda.Fr...@state.ma.us on 23 May 2013 at 3:13