planetfederal / gxp

High level components for GeoExt based applications.
http://boundlessgeo.com/
Other
84 stars 97 forks source link

Fix - GXP layers with "fixed : true" can be removed #142

Closed davicustodio closed 12 years ago

davicustodio commented 12 years ago

I'm having problems with the attribute set to the gxp layers with fixed: true, the context menu gxp_removeLayer keeps popping and clicking makes the exclusion of the layer ... according to the documentation fixed: true specifies that the layer can not be moved and not excluded, but the gxp not respect it ..

Looking for the problem, I noticed that nowhere in the code the gxp the issue of a fixed = true layer was treated to avoid foreclosure ... to correct the problem RemoveLayer.js changed the code starting at line 72 ...

the code is here @ b8490f7

ahocevar commented 12 years ago

Thanks @davicustodio. To not change the behavior of our existing applications, you would also have to change some LayerSource plugins (e.g. Bing, Google), which have false as defaultValue for the fixed property, to just remove that default. Otherwise people who add layers through the AddLayers plugin won't be able to remove them any more.

davicustodio commented 12 years ago

@ahocevar, the line "selectedLayer.get ("layer"). params ["FIXED"]" is not part of API gxp, was a particular implementation that includes layers for real added directly to the OpenLayers with a parameter called forced FIXED. Already removed the line and change can be seen here: 497aeaa

Regarding the fact that the change will impact the add layers through the AddLayers plugin, i agree with you. I will implement these changes and then post here again.

Thank you.

davicustodio commented 12 years ago

@ahocevar Hello, I applied the changes you suggested. They affected the classes GoogleSource, BingSource, and MapQuestSource OSMSource. In short, were removed from the default values ​​for the parameter "fixed" in these classes.

da502af

Update src/script/plugins/GoogleSource.js
3880172

Update src/script/plugins/BingSource.js 1254ee9

Update src/script/plugins/MapQuestSource.js 4d2e189

Update src/script/plugins/OSMSource.js

davicustodio commented 12 years ago

New Featuere - Layers Autoextent !

Added autoextent the attribute that allows a layer to parameterize that when selected will automatically be made a zoomToExtent. I understand that it will be useful for raster layers of the type that can be selected and due to its lesser extent over the map, is not visible to the user ... With autoextent the user is automatically directed to the extension of the raster, looking for without having to navigate the layer ..

cd6ff18

Update src/script/plugins/WMSSource.js
f6fea56

Update src/script/plugins/LayerTree.js

ahocevar commented 12 years ago

Why did you close the original pull request and repurpose it? We can only review and merge your contribution if you keep it separate, and do not mix it with other customizations. So please create a feature branch for the fixed attribute improvements.

davicustodio commented 12 years ago

Andreas, I'm sorry, I'm still adapting to the github. I'll close this pull request, and open another. Thank you.