[OpenLayers-Users] Style of line which geometry is being changed

paweluz paweluz at o2.pl
Tue Feb 2 13:58:07 EST 2010


Hi Max
Sorry I did not writ sooner but unfortunately I was sick... Today I was
trying your solution but I got error "Invalid label " like this:


Error: invalid label
Source code:
    drawControls["modify_wfs_layer"].initialize: function(zielona_wfs) { 
                                                 ^


My code looks like this:


            drawControls = {
                chooseobject: new OpenLayers.Control.SelectFeature(
					zielona_wfs,
					{
						onSelect: onFeatureSelect	
					}
				),
			
		modify_wfs_layer: new OpenLayers.Control.ModifyFeature(zielona_wfs)
                ,
                point: new OpenLayers.Control.DrawFeature(
                    vector, OpenLayers.Handler.Point
                ),
                line: new OpenLayers.Control.DrawFeature(
                    vector, OpenLayers.Handler.Path
                ),
		add_object:new OpenLayers.Control.DrawFeature(
                    zielona_wfs, OpenLayers.Handler.Path
                ),
                polygon: new OpenLayers.Control.DrawFeature(
                    vector, OpenLayers.Handler.Polygon
                )
            };
			
    drawControls["modify_wfs_layer"].initialise: function(zielona_wfs) {
        this.layer = zielona_wfs;
        this.vertices = [];
        this.virtualVertices = [];
        this.virtualStyle = OpenLayers.Util.extend({},
            this.layer.style || this.layer.styleMap.createSymbolizer());
        this.virtualStyle.fillOpacity = 1;
        this.virtualStyle.strokeOpacity = 1;
        this.deleteCodes = [46, 68];
        this.mode = OpenLayers.Control.ModifyFeature.RESHAPE;
        OpenLayers.Control.prototype.initialize.apply(this, []);
        if(!(this.deleteCodes instanceof Array)) {
            this.deleteCodes = [this.deleteCodes];
        } 			
			
	drawControls["add_object"].featureAdded = function(feature) {
                feature.layer.eraseFeatures([feature]);
                // dodawanie obiektu do bazy danych
                feature.geometry = new OpenLayers.Geometry.MultiLineString(
                    feature.geometry
                );
				selectedfeature=feature;
                feature.state = OpenLayers.State.INSERT;
                feature.layer.drawFeature(feature);
            }



I honesly have now idea how to make i right and what is wrong. I do not even
if I made right changes in the code you gave me. I did not use any options
as you can see... Can you look on my code and tell me or give me a clue what
is wrong... 

Thanks,
Poul 
-- 
View this message in context: http://n2.nabble.com/Style-of-line-which-geometry-is-being-changed-tp4469289p4502826.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list