How to add only points to a feature collection layer??

809
4
05-16-2018 05:27 AM
VijitWadhwa
New Contributor III

I created a FeatureCollectionTable for multi points , when i am trying to add FeatureCollectionLayer to map, then it gives me an Null Reference Exception (Object reference not set to an instance of object) ?? Why is it so ??

But if i create feature for points , line and polygon also then the application runs fine ?? I am not able to understand this issue. If in case my features are only point features then what is the need to add other features to map ??

0 Kudos
4 Replies
MichaelBranscomb
Esri Frequent Contributor

Hi,

Are you able to share the full snippet of code you're using to create the FeatureCollectionTable and FeatureCollectionLayer?

Cheers

Mike

0 Kudos
VijitWadhwa
New Contributor III

Hi Mike,

I am sharing the two images , each image has a method which i am using , the first image has a method named addMultiPoints() and the second mehtod is CreateRenderer().

The exception comes at the last line of first method i.e addMultiPoints() , but when i create all features i.e Point , Polygon and Line , then the application runs fine. My requirement is to add only one feature.

the second image is

Thanks in advance

0 Kudos
VijitWadhwa
New Contributor III

Hi,

Sir as per your request, I posted the complete code , Kindly go through it once and help me solving the issue? Thanks in advance

0 Kudos
dotMorten_esri
Esri Notable Contributor

Could you please create a project and zip it up? There's still code missing. The exception seems to indicate your exception happens on the mapView.Map but I don't see any reference to how that is all set up. The best thing is to create a small sample project that reproduces that error and share it with us.

0 Kudos