Details
Description
MapContent is advertised in the docs as the class to use in preference to MapContext for new development. The attached patch does the following:
- adds setMapContent and getMapContent methods to GTRenderer and StreamingRenderer
- replaces the MapContext instance in StreamingRenderer with a MapContent instance
- deprecates setContext and getContext methods
Issue Links
Activity
Michael Bedward
made changes -
Michael Bedward
made changes -
| Attachment | shapefile-renderer-mapcontent.patch [ 54998 ] |
Michael Bedward
made changes -
| Attachment | renderer-mapcontent2.patch [ 55037 ] |
Michael Bedward
made changes -
| Attachment | combined-renderer-mapcontent.patch [ 55415 ] |
Andrea Aime
made changes -
| Attachment | GEOT-3565-aaime.patch [ 55417 ] |
Andrea Aime
made changes -
Jody Garnett
made changes -
Jody Garnett
made changes -
| Comment |
[ Hey guys - I am going to try something. I am worried that I have been too pig headed about this. The real motivation for Layer was to make the constructors make sense - not to make Andrea's life difficult. I think with my object-oriented hat on, wanting each class to have a minimal responsibility, I have made things too difficult / risky.
I am going to look at pulling the getStyle() and getFeatureSource() and getQuer() methods up into Layer (and having them return "empty" content). I can explain in the javadocs that these methods are used by feature based renderers; and the default implementation only needs to be overridden if your Layer has something to say. I would hope this would avoid the amazing amount of casts witnessed in Andrea's and Micheal's patches. I don't think it impacts on the clarity of the interfaces; the constructors are still clear; we still have concrete implementations each of which has their own specific "workarounds" for providing a FeatureSource - and since it is not tired up in conditional code I hope it would be readable. ] |
Jody Garnett
made changes -
| Attachment | mega_patch.patch [ 55621 ] |
Jody Garnett
made changes -
| Attachment | combined_mega_patch.patch [ 55634 ] |
Andrea Aime
made changes -
| Attachment | combined_mega_patch.patch [ 55837 ] |
Andrea Aime
made changes -
| Attachment | GEOT-3565-context-fix.patch [ 55839 ] |
Andrea Aime
made changes -
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Resolution | Fixed [ 1 ] |
I also see that the patch removes some c coding style bits with more java like ones (David B. used to code in java as it that was C in fact), but I'm unsure if all of them are actually equivalent. See this bit:
{code}
// skip layers that do have only one fts
- if(layer.getStyle().getFeatureTypeStyles().length < 2)
+ if (!(layer instanceof FeatureLayer)) {
continue;
+ }
+ FeatureLayer featureLayer = (FeatureLayer) layer;
+
+ if (featureLayer.getStyle().featureTypeStyles().size() < 2) continue;
+
{code}
Maybe it is equivalent but after 10 hours of work I'm too tired to tell :-p
Allow me some more time to look into the patch. Maybe next time split it into two, code cleanups in one patch, api changes in the other.