iOS:Arcgis:featureLayer.types 返回 Null

发布于 2024-11-02 10:42:22 字数 909 浏览 3 评论 0原文

我正在尝试在图层内添加要素类型(featureLayer.types),以便用户可以选择一个。 ESRI 的示例“FeatureLayerEditingSample”执行此操作,但视图控制器是通过之前的视图控制器初始化的。 http://www.arcgis.com/home/item.html?id=2ddb261648074b9aabb22240b6975918

当我尝试时循环遍历我的 featureLayer 的类型,它不会返回任何内容并且 [self.featureLayer.types count] 返回 0。

我想我缺少一些需要设置为 featureLayer 的基本属性。感谢这方面的任何帮助。

我的 viewDidLoad 方法是这样的:

self.featureLayer = [AGSFeatureLayer featureServiceLayerWithURL:[NSURL URLWithString:@"http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/0"] mode:AGSFeatureLayerModeOnDemand];
NSArray* types1 = self.featureLayer2.types;
AGSFeatureType* selectedType1 = [types1 objectAtIndex:2];
NSLog(@"count of types is %d \n", [selectedType1.types count]); //returns 0

非常感谢!

I am trying to feature types (featureLayer.types) within a layer so that the user can select one.
ESRI's Sample "FeatureLayerEditingSample" does this but the view controller is initialized through the previous View Controller there. http://www.arcgis.com/home/item.html?id=2ddb261648074b9aabb22240b6975918

When I try to loop through the types of my featureLayer, it doesn't return anything and
[self.featureLayer.types count] returns 0.

I think I'm missing some basic properties that need to set to the featureLayer. Appreciate any help in this.

My viewDidLoad method goes like this:

self.featureLayer = [AGSFeatureLayer featureServiceLayerWithURL:[NSURL URLWithString:@"http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/0"] mode:AGSFeatureLayerModeOnDemand];
NSArray* types1 = self.featureLayer2.types;
AGSFeatureType* selectedType1 = [types1 objectAtIndex:2];
NSLog(@"count of types is %d \n", [selectedType1.types count]); //returns 0

Thanks a ton!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笨笨の傻瓜 2024-11-09 10:42:22

您需要先将该功能添加到mapView中。在添加之前,它不会从 MapService 检索信息。您应该指定一个 Layer Delegate,以便您可以侦听 Layer 是否成功加载。

You need to add the feature to the mapView first. It won't retrieve the information from the MapService until it's been added. You should specify a Layer Delegate so that you can listen for the Layer to be loaded sucessfully.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文