smas1 / geoext-viewer

Automatically exported from code.google.com/p/geoext-viewer
GNU General Public License v3.0
0 stars 0 forks source link

Vector Styler - changes all styles when none selected. #345

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This one is very significant for us as it renders the tools unusable 
unfortunately.

1) Create 4 polygons - they'll be the default blue.
2) "Change Feature Style" -> Edit
3) Change the fill colour to Red.

Now *all* of the polygons have turned red!
But *none* of them should have changed colour as none were selected.

---
Related issue.
1) Create 4 polygons.
2) Select one of them.
3) Change the colour (red) for that polygon.
There are now 3 blue and one red polygon.
4) Select another polygon... it is instantly changed to Red.

I can see circumstances where this cloning of styles would be useful, but I 
don't think it should be the default.

Not sure how I missed these two. Sorry about that.

Original issue reported on code.google.com by jonathan...@warwickshire.gov.uk on 11 Mar 2014 at 2:17

GoogleCodeExporter commented 9 years ago
I cannot reproduce the first case (see att.), this is what was recently fixed, 
maybe not in 1.0.1 but I cannot reproduce on 
http://lib.heron-mc.org/heron/latest/examples/vectorstyler/ in Chrome Mac OSX. 
Is it in all browsers?

The second case is as intended: when changing a style, all selected objects are 
restyled and that style becomes the new style, as is also clear in the Legend 
but now I see it is not entirely as in the original wording:

   User actions
   There will be two possible workflows to let the user do this.
    - User draws features and needs to select them to change the style of them. 
    - User sets style, then any features drawn thereafter become that colour (like a paint program). 
       Of course they can later change the style using the other method.

Original comment by jus...@gmail.com on 11 Mar 2014 at 3:29

Attachments:

GoogleCodeExporter commented 9 years ago
Using Heron latest from earlier today, this happens on all web-browsers tried.

Looking at the online example, I see that it has a different style editor 
dialog - I only have one rule (default) where you have three. See attached.

My configuration for the drawing tools is the attached js file; maybe it's a 
config issue?

Original comment by jonathan...@warwickshire.gov.uk on 11 Mar 2014 at 5:46

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Just,
Any thoughts on this? We can't use the tools until this issue is resolved.
Cheers,
Jonathan

Original comment by jonathan...@warwickshire.gov.uk on 18 Mar 2014 at 1:29

GoogleCodeExporter commented 9 years ago
Well, first, do both issues, especially the first, you mention occur in the 
example?

http://lib.heron-mc.org/heron/latest/examples/vectorstyler

If not then there is something different in your app setup. Possibly your 
configuration but more likely that there is a difference in one of the JS 
resources, possibly GXP as the behaviour was there before I solved it.
..<looking into configs>....Aha, I think I know what is the case now, your 
drawinglayer possibly does not have customStyling: true. This happens when you 
have OLE create that Layer.

So in my case:

/* Vector layers for Drawing and Upload */
Ext.namespace("Heron.options.worklayers");
Heron.options.worklayers = {
    editor: new OpenLayers.Layer.Vector('DrawingLayer', {
        displayInLayerSwitcher: true, visibility: false, customStyling: true}),

    scratch: new OpenLayers.Layer.Vector('UploadLayer', {
        displayInLayerSwitcher: true, visibility: false})
};

and then in editor config:

    {type: "oleditor", options: {
        pressed: true,

        // Options for OLEditor
        olEditorOptions: {
            editLayer: Heron.options.worklayers.editor,
            activeControls: ['StyleFeature', 'UploadFeature', 'DownloadFeature', 'Separator', 'Navigation', 'SnappingSettings', 'CADTools', 'Separator', 'DeleteAllFeatures', 'DeleteFeature', 'DragFeature', 'SelectFeature', 'Separator', 'DrawHole', 'ModifyFeature', 'Separator'],
            // activeControls: ['UploadFeature', 'DownloadFeature', 'Separator', 'Navigation', 'DeleteAllFeatures', 'DeleteFeature', 'DragFeature', 'SelectFeature', 'Separator', 'ModifyFeature', 'Separator'],
            featureTypes: ['text', 'polygon', 'path', 'point'],
            language: 'en',
            options: {
                StyleFeature: {
                    pageX: 200,
                    pageY: 100
                }},
.
.

Since the Editor is so specific in its styling demands I saw no other way than 
to mark it as special via 'customStyling'. This conditionally executes code 
w.r.t. vector object types and selection. I am now sure that that is the matter.

Original comment by jus...@gmail.com on 18 Mar 2014 at 1:56

GoogleCodeExporter commented 9 years ago
Thanks for the information. I didn't actually have either of the worklayers 
defined as separate OpenLayers anywhere in my app but it was working fine.

However creating them and adding the customStyling:true line fixed the issue.

Original comment by jonathan...@warwickshire.gov.uk on 19 Mar 2014 at 11:39