[OpenLayers-Users] feature.geometry does not exist

Christopher Schmidt crschmidt at metacarta.com
Thu Feb 26 20:51:23 EST 2009


On Fri, Feb 27, 2009 at 02:31:46PM +1300, Robert Connolly wrote:
> Hi Everyone,
> 
>  
> 
> I'm attempting to read some features from a GeoJSON encoded object
> transform them for the correct projection and add them to a vector
> layer, like so:
> 
>  
> 
> var feature = geojson_format.read(data[j]);
> 
> feature.geometry.transform(new OpenLayers.Projection("EPSG:4326"),
> map.getProjectionObject());

http://dev.openlayers.org/apidocs/files/OpenLayers/Format/GeoJSON-js.html#OpenLayers.Format.GeoJSON.read

"The return depends on the value of the type argument.  If type is
“FeatureCollection” (the default), the return will be an array
of OpenLayers.Feature.Vector."

feature[0].geometry.transform

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list