I have a fairly straightforward code like so, with the JSON data coming out of 
Pg. I am using OL 2.11

    var data = {
      "type" : "FeatureCollection"
      "features" : [
         {
            "geometry" : {
               "coordinates" : [[[x1, y1], [x2, y2], [x3, y3]]],
               "type" : "MultiLineString"
            },
            "type" : "Feature",
            "properties" : {"code" : 101, "desc" : "blah" }
         },
         {
            "geometry" : {
               "coordinates" : [[[x1, y1], [x2, y2], [x3, y3]]],
               "type" : "MultiLineString"
            },
            "type" : "Feature",
            "properties" : {"code" : 102, "desc" : "blah" }
         },
         {
            "geometry" : {
               "coordinates" : [[[x1, y1], [x2, y2], [x3, y3]]],
               "type" : "MultiLineString"
            },
            "type" : "Feature",
            "properties" : {"code" : 103, "desc" : "blah" }
         },
      ]
    }
    
    var geojson_format = new OpenLayers.Format.GeoJSON();
    var lyr = new OpenLayers.Layer.Vector("layer name"); 
    PK.vars.map.addLayer(lyr);
    trenches.addFeatures(geojson_format.read(data));

Yet, no errors and no features drawn on the map. What am I doing wrong?

Puneet._______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to