[OpenLayers-Users] Content-type and Save strategy

Marc-André Trottier marcandre_trottier at hotmail.com
Fri Sep 16 10:07:08 EDT 2011


With Openlayers 2.11
it works :

OpenLayers.Strategy.Save.prototype.save = function(features) {
        if(!features) {
            features = this.layer.features;
        }
        this.events.triggerEvent("start", {features:features});
        var remote = this.layer.projection;
        var local = this.layer.map.getProjectionObject();
        if(!local.equals(remote)) {
            var len = features.length;
            var clones = new Array(len);
            var orig, clone;
            for(var i=0; i<len; ++i) {
                orig = features[i];
                clone = orig.clone();
                clone.fid = orig.fid;
                clone.state = orig.state;
                if(orig.url) {
                    clone.url = orig.url;
                }
                clone._original = orig;
                clone.geometry.transform(local, remote);
                clones[i] = clone;
            }
            features = clones;
        }
        this.layer.protocol.commit(features, {
            callback: this.onCommit,
            scope: this,
            headers: {'Content-Type': 'text/xml'}
        });
    };

Marc-André Trottier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110916/afae3484/attachment.html


More information about the Users mailing list