[OpenLayers-Users] Properties of Vector Features to be printed Using MapFish Print

Mark Prins mc.prins at gmail.com
Sat Feb 15 02:16:58 PST 2014


2014-02-14 23:07 GMT+01:00 Jerome A. Wendell <jawendell at suddenlink.net>:
> I basically have the spec to print my map with the desired layers, except
> for one property that I have not been able to include in the geojson string
> for the features.  I am using OpenLayers Version 2.12.  The spec is as

>
> I have highlighted the property that I need to include in the spec.  I have
> tried to add it to the geoJson representing the feature by using the
> following code:
>
>
>
>                 var featureFormat = new OpenLayers.Format.GeoJSON();
>
>                 var featureGeoJson = featureFormat.write.call(
>
>                                 featureFormat, feature);
>
>                 featureGeoJson.properties = OpenLayers.Util.extend({
>
>                                 _gx_style: 1
>
>                                 },featureGeoJson.properties);
>

I'd try extending/modifying the feature before serializing to json,
something like:
```
feature.data._gx_style = 1;
var featureGeoJson = featureFormat.write.call(featureFormat, feature);
```

-- 
Disclaimer;
This message is just a reflection of what I thought at the time of
sending. The message may contain information that is not intended for
you or that you don't understand.


More information about the Users mailing list