[OpenLayers-Users] GeoJSON MultiPoint Features [SEC=UNCLASSIFIED]

John Phan J.Phan at bom.gov.au
Sun Feb 14 23:40:38 EST 2010


Hi,

I'm kind of new to OpenLayers. But I want to use GeoJSON to request geometric features using the geometric type: MultiPoint.

The browser has no problems rendering the vector layer.

Now how do I associate an onclick event with each of these points (rather than a collection of points).

My OL code looks like this.
....
var pointsLayer = new OpenLayers.Layer.Vector("A Layer", {
	strategies: [new OpenLayers.Strategy.Fixed()],
      protocol: new OpenLayers.Protocol.HTTP({
      	url: "multipoints.json",
      	format: new OpenLayers.Format.GeoJSON()
      })
});
map.addLayer(pointsLayer);
....

And my geojson file looks like this:

{
    "type": "Feature",
    "id": "OpenLayers.Feature.Vector_336",
    "properties": {
    },
    "geometry": {
        "type": "MultiPoint",
        "coordinates": [ [176.5,-15.0],[177.2,-15.1],[178.0,-15.1],[178.4,-15.1] ]
    }
}

Thanks,
John


More information about the Users mailing list