Select to view content in your preferred language

An error code

1978
9
09-09-2021 01:19 AM
雪原高
New Contributor

Hello, I am using ArcGIS Runtime API for iOS 100.11 version, but 10.2.4 was used before the project. I am modifying the code of the project, and I don't know how to modify the wrong content of some codes in the project. I hope you can help me solve it.

 

0 Kudos
9 Replies
RyanOlson1
Esri Contributor

Very similar question was answered here.

There is a document here describing migration changes from 10.2.x to 100.x. 

The home page for the iOS runtime SDK provides many samples and sample code. Also the API reference is available.

Per the screen shots you provided:

To add a layer to a map view, you add the layer to an AGSMap through the operationalLayers property and then assign the AGSMap to your AGSMapView.

 

The code now would look something more like:

AGSMap* map = [[AGSMap alloc]init];
[map.operationalLayers addObject:TianDyTuLyr];
[map.operationalLayers addObject:TianDyTuLyr_Anno];
self.mapView.map = map;

 

Alternatively, you can add your layers to the AGSMap.basemap if that better suits your intention.

0 Kudos
雪原高
New Contributor

Hello, I added layers according to the method you said, but the map could not be displayed on the APP. Could you please check the reason?

0 Kudos
雪原高1027
Emerging Contributor

Hello, I am trying to draw the trace, I am trying to add the AGSPolylineBuilder object through the AGSGraphic, but it crashes here,as shown in my screenshot. Please kindly see how to add the AGSPolylineBuilder object to draw the trace.

0 Kudos
RyanOlson1
Esri Contributor

You are passing an `AGSPolylineBuilder *` to a function that takes an `AGSGeometry *`.  You need to call `toGeometry` on your builder to get a geometry that you can pass to the function.

0 Kudos
雪原高1027
Emerging Contributor

First, thank you for your feedback. I have another problem, on the map display, I want to show the track, but only the mark points of AGSPictureMarkerSymbol are shown here, and the words I wrote AGSSimpleLineSymbol are not shown on the map. Please help to check whether there is a problem with the code?

0 Kudos
RyanOlson1
Esri Contributor

By a quick visual inspection, nothing stands out as being incorrect per se in that code dealing with the line symbol.  I think you should spend some time debugging it and making sure that your poly line geometry is properly formed as you would expect.  Unfortunately this forum isn't setup for debugging, you will need to do that on your own.  In terms of your original question in this thread, I think that has been answered.  Please continue to look at the migration doc that we linked to above for migration issues.

0 Kudos
RyanOlson1
Esri Contributor

Also, you can look in our samples repo for similar examples that do what you are trying to do.  This sample in particular seems to be related to your project.

0 Kudos
雪原高1027
Emerging Contributor

Hello, I used ArcGIS Runtime for ios framework in my project. The map could be displayed normally in the simulator, but when I tested it on a real machine, the phone would be stuck and the project could not run. ArcGIS Runtime Error Occurred is displayed in the log. I do not understand the specific problem, please help to solve it.

0 Kudos
Nicholas-Furness
Esri Regular Contributor

Since this is a new problem, not related to migrating layers from 10.2.4 to 100.1, please start a new thread in the forum.

A good title might be "Map displays in simulator but not on device". That will help people know if they can step in and help. Others may also have the same issue and they'll be able to find this thread and see how we resolve it.

And please be sure to include details about the error. That was missing from your last reply above.

Thank you!

0 Kudos