[Geojson] Adding extra data to a geojson string

Chitraleka Appalanaidu achitraleka at gmail.com
Sun Nov 1 16:39:59 PST 2009


Hi all,

I have a geojson file that I pass to the penLayers.Format.GeoJSON parser.
This parser converts the a geojson string (as below) to a
OpenLayers.Vector.Feature object and adds it into an OpenLayers Vector layer
(that performs clustering)

{
    "type": "FeatureCollection",
    "features": [
        {"type":"Feature", "id":"1", "properties":{},
"geometry":{"type":"Point", "coordinates":[143, -35.91]}},
        {"type":"Feature", "id":"2", "properties":{},
"geometry":{"type":"Point", "coordinates":[144, -37.81667]}}
    ]
}


The problem with adding it into a clustering layer is that any properties I
add into the "properties":{} field in the above geojson file will get
overriden (because clustering will cause a count value to be entered into
the properties list).

I would like to add other information about a point in the geojson file
above. Is there any other key-value pair i can use to do this? I have tried
the 'fid' and 'style' key-value pairs but the parser does not seem to parse
them out into a OpenLayers.Vector.Feature object.

Thank you.

Kind regards,
Chitra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geojson.org/pipermail/geojson-geojson.org/attachments/20091102/8a3f3d90/attachment.htm>


More information about the GeoJSON mailing list