geoext / geoext2

GeoExt 2 — JavaScript Toolkit for Rich Web Mapping Applications
http://geoext.github.io/geoext2/
Other
142 stars 106 forks source link

Add example for loading features via ProtocolProxy #318

Closed chrismayer closed 9 years ago

chrismayer commented 9 years ago

Added another example to show how to use a GeoExt.data.proxy.Protocol to load features into a FeatureStore and sync this store with a vector-layer.

marcjansen commented 9 years ago

Thanks for this. I have three very minor and cosmetic remarks:

  1. Can you use the following as the background of the attribution control? I personally like this better, Your mileage may vary.

    diff --git a/examples/grid/feature-grid-w-proxy.html b/examples/grid/feature-grid-w-proxy.html
    index 044e23e..64bba6f 100644
    --- a/examples/grid/feature-grid-w-proxy.html
    +++ b/examples/grid/feature-grid-w-proxy.html
    @@ -14,7 +14,8 @@
    
               <style>
                   div.olControlAttribution {
    -                           background-color: #157FCC;
    +                           background-color: rgb(237,237,237);
    +                           background-color: rgba(237,237,237,0.7);
                       }
               </style>
  2. Can we have a more distinct selected style of the features in the map? Sth. like:

    diff --git a/examples/grid/feature-grid-w-proxy.js b/examples/grid/feature-grid-w-proxy.js
    index 9a6b420..a4b1b49 100644
    --- a/examples/grid/feature-grid-w-proxy.js
    +++ b/examples/grid/feature-grid-w-proxy.js
    @@ -55,10 +55,22 @@ Ext.application({
            strokeColor: "yellow",
            graphicName: "circle"
        };
    -        var style = new OpenLayers.Style(template);
    +        var defStyle = new OpenLayers.Style(template);
    +        var selStyle = new OpenLayers.Style(
    +                Ext.apply(
    +                    Ext.apply({}, template),
    +                    {
    +                        strokeWidth: 3,
    +                        pointRadius: 15,
    +                        fontSize: "15px",
    +                        fontWeight: "bold"
    +                    }
    +                )
    +            );
        var vecLayer = new OpenLayers.Layer.Vector("vector", {
            styleMap: new OpenLayers.StyleMap({
    -                'default': style
    +                'default': defStyle,
    +                select: selStyle
            })
        });
  3. You are mixing tabs and spaces in both html and js. Would you mind changing this to be all spaces?

This is a long comment, but everything is absolutely minor.

Please merge with or without adressing my remarks.

chrismayer commented 9 years ago

Thanks for the review @marcjansen, I adressed your comments and added two more commits.

marcjansen commented 9 years ago

Great & thanks, please merge!