Taken from here: #711550: Some layers can't be added and shouldn't be added

The problem is that Views Data Layers show up in the layers list (admin/build/openlayers/layers) which means there is an Edit and Clone operations for them. The Views Data Layers should not show up in this list.

We could use a "ui_visibility" property like with behaviors. This could be on a layer or layer_type level. But technically we do want it in the preset UI.

CommentFileSizeAuthor
#3 openlayers_views_handling.patch3.89 KBtmcw

Comments

tmcw’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev

Marking as 2.x. I think that views layers should show up in the list, but shouldn't have the operations available to modify them via that interface. And actually I'm starting to think that it should be possible to edit openlayers views layers through that interface - which could be useful in special cases like restricting the zoom levels in which they appear.

zzolo’s picture

Title: Views data layers should not show up in layers list » Views data layers needs special handling

Makes sense. Either way, we need some special logic for views data layers.

Though, for something like the zoom level, I would think that putting that in the Views interface as an option might be good, more from a UI standpoint. Having to go back to the Layers interface to edit the zoom level seems like a lot. Just a thought.

tmcw’s picture

Status: Active » Needs review
StatusFileSize
new3.89 KB

Patch attached that prevents users from exporting and cloning OpenLayers data layers. I think that this is the way to go (instead of redirecting) because it keeps the user experience consistent (doesn't jump interfaces) and also educates users in how OpenLayers Views work. Can you give this a quick look? I've tested it and think it's ready to commit.

zzolo’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @tmcw. A quick site review: seems like all the logic is good. Some minimal things that can be addressed later are there are a couple coding standard mishaps, and there is probably a better way to make that code shorter. But I would give the go ahead if you are confident with it.

tmcw’s picture

Status: Reviewed & tested by the community » Fixed

Committed: http://drupal.org/cvs?commit=367040

As far as code style, some of this is a bit ugly, but passes coder with no warnings, and one must balance the evils of creating lots of 'alias variables' and looking at long variable addressing like $form['#parameters'][2]->data['layer_type']

zzolo’s picture

Sure. No big deal. Please note, though, that Coder does not actually get 100% coding standards.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.