0

I can not see my feature on the map. What can be the problem?

Here is my code.

 `layerDefinition = {
      "geometryType": "esriGeometryPolygon",
      "fields": [{
      "name": "PROPIN",
      "type": "esriFieldTypeInteger",
      "alias": "Buffer Distance"
      }]
      };

  featureCollection = {
  layerDefinition: layerDefinition,
  featureSet: null
  };


   SearchFeatlayer = new FeatureLayer(   
   featureCollection,{
   showLabels: true,
   id:"Subject_Parcel",
   name: 'Subject_Parcel',
   layerId : "0",
   infoTemplate:infoTemplatenew
   });


 var SymbolNewCreatedLayer = new esri.symbol.SimpleFillSymbol();
 SymbolNewCreatedLayer.setColor(new dojo.Color([0,0,0,0.5]));

  var renderer = new esri.renderer.SimpleRenderer(SymbolNewCreatedLayer);


    var polygonJson  = {"rings":[[[123.9013448720001,10.400545128000033],[123.90130944200007,10.400461914000061],[123.90128004300004,10.400474234000058],[123.90131547300007,10.40055744700004],
    [123.90135090400008,10.400640661000068],[123.90138030300011,10.400628341000072],[123.9013448720001,10.400545128000033]]],"spatialReference":{"wkid":4253 }};
    var polygon = new Polygon(polygonJson);

    SearchFeatlayer.add(polygon);

    SearchFeatlayer.setRenderer(new esri.renderer.SimpleRenderer(SymbolNewCreatedLayer));   
    map.setExtent(polygon.getExtent());
    map.addLayer(SearchFeatlayer); 
    map.getLayer("Subject_Parcel").refresh();  

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.