[OpenLayers-Users] Find out about the geometrytype of a layer

Alexandre Dube adube at mapgears.com
Wed Apr 14 08:11:07 EDT 2010


Barbara,

I'm not sure what's going on, but I see you're using OpenLayers 
compressed. Try switching to uncompressed version and set a breakpoint 
in Vector.js in the addFeatures method (I guess the error is there). Is 
the feature correctly set to MultiLineString before it's added ? Try to 
look in firebug if that's the case.

Regards,

Alexandre


Barbara Fiederer wrote:
> Hi Alexandre,
> I added
> "myLayer.addOptions({geometryType:"OpenLayers.Geometry.MultiLineString"});"
> to the Layer options. -> Control in firebug: property is set correctly
>
> In geoserver: the_geom = MultiLineString
>
> the Control ist defined as follows:
> var mydraw = new OpenLayers.Control.DrawFeature(
> layer, OpenLayers.Handler.Path, {
> title:"new line",
> displayClass:"olControlDrawFeatureLine",
> handlerOptions:{multi:true}
> }
> );
>
> On finishing the line by doubleclick firebug throws an error: "invalid
> 'instanceof' operand this.geometryType
> var feature=features[i];if(this.geomet...ototype.CLASS_NAME});throw
> throwStr;} OpenLayers.js (Zeile 1472)"
>
> Before setting the GeometryType editing worked fine.
>
> Thanks for answering.
>
> Barbara
>
>   


-- 
Alexandre Dubé
Mapgears
www.mapgears.com




More information about the Users mailing list