|
POST
|
You could record a journey to a GPX file using GPS tracking software of your choice and then test your Runtime app using the AGSGPXLocationDataSource. Create a new instance of that pointing at your GPX file, then set your mapView.locationDisplay.dataSource to this new instance.
... View more
10-08-2018
10:42 AM
|
2
|
1
|
12657
|
|
POST
|
Glad it working for you, but that's odd. It shouldn't matter. I just tried to reproduce this with your original code and it adds features fine. Could you have made some other edit to the code in the meantime? Can you try setting self.pointFeatureLayer as in your original code again just as a sanity check?
... View more
09-28-2018
08:29 AM
|
1
|
0
|
1926
|
|
POST
|
Oh yes, I'm sorry. I missed the "self". You could do a couple of things to dig in. I assume the service URL is HTTPS and not HTTP. If it's HTTP, make sure your App Transport Security settings allow that. Turn on debugging on the global AGSRequestConfiguration to see what's being sent and what, if anything, is being returned. AGSRequestConfiguration.global().debugLogRequests = true
AGSRequestConfiguration.global().debugLogResponses = true Let me know what you find.
... View more
09-28-2018
05:13 AM
|
1
|
0
|
1926
|
|
POST
|
Hey John Bridges. The other URL was nearly there. This is just how we published the world routing service. We're working on better documentation to make this easier to discover. Cheers, Nick
... View more
09-27-2018
04:15 PM
|
0
|
1
|
1606
|
|
POST
|
Hi, Try using this URL: https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World Also, take a look at this for an example of using the tasks. Let me know if that helps.
... View more
09-27-2018
11:45 AM
|
0
|
3
|
1606
|
|
POST
|
We don't have an alternate image property that you can just switch to when you click the marker. You would have to manually switch the symbol, and how you do that would depend on whether the marker comes from a feature service or is a graphic in a graphics overlay. There are a couple of possible approaches. You could manipulate the renderer on the layer to display that particular marker differently. How complex this approach is will depend on the renderer defined on the layer. In the simplest case, you would replace the layer's AGSSimpleRenderer with an AGSUniqueValueRenderer that has the default symbol as the old AGSSimpleRenderer's symbol, and a single AGSUniqueValue keyed off the feature's ObjectID to display only that feature differently. Add and remove AGSUniqueValues for each feature that is "toggled on". You could hide that marker (using setFeature:visible()) and use an AGSGraphicsOverlay to display the replacement marker. Depending on your requirements, you could use the Selection logic to highlight the marker (but it sounds like that won't suffice for you). If the marker is in an AGSGraphicsOverlay, then you could simply switch the symbol on the graphic. You could alternatively use a renderer and make sure each graphic in the overlay has an attribute that suitably drives the renderer, a bit like the first option above but with total control over the field used to drive things. There may be other approaches I haven't thought of. I've used the first approach myself and it works well, but only if you understand the original renderer.
... View more
09-27-2018
08:31 AM
|
1
|
1
|
2236
|
|
POST
|
As soon as your pointFeatureTable variable goes out of scope it'll be deallocated, and so there's nothing left to call back into your callback blocks. Try creating a class-level variable to keep your pointFeatureTable reference in, or derive it from a layer in the map (the map will keep a layer reference, and the layer will keep a table reference). See this sample, where the featureTable variable is defined at the class level, so will exist as long as the owning class does.
... View more
09-27-2018
08:20 AM
|
1
|
2
|
1926
|
|
POST
|
Hey Jake, In the 10.2.x Runtime (which Asif is using) that's what the AGSQueryTask does (plus it integrates with the credential cache). Just initialize it with a URL to the service, and start firing queries against it. The NSOperation you get back can be cancelled if need be. In the 100.x runtime, you can hold on to a reference to an AGSServiceFeatureTable that you load once and query against often (actually, you don't need to load it explicitly - any calls to query will take care of loading it). You don't need to create a layer from it or add it to a map. And when you run a query against it, you get back an AGSCancelable, which you can… as you might expect… cancel The only limitation is that you can't list specific fields for the query. There's a sort of workaround for that involving setting the featureRequestMode to manualCache and populating the table using the query and fields you're after, then querying the table (which will run off the local cache and return immediately), but that is admittedly a bit tricky and if you have parallel queries going on with different field sets you'd want to have separate table instances; one for each field set. Lastly, 10.2.x's AGSQuery.returnGeometry and 100.x's AGSQueryParameters.returnGeometry can be set to false to prevent geometry being returned. Asif: If you can't control CLLocationManager.distanceFilter, then in your locationUpdate handler you could use AGSGeometryEngine.distanceFromGeometry:toGeometry() to see how far the new point is from that last acceptable point, and only fire a query once the distance has reached a threshold. So, you're still getting as many updates from CoreLocation, but you're not firing queries off until you've moved a sensible amount. Also, in your sample code, before your "do" block, set up a "let trafficSpeedLayer = ..." there. Right now, as soon as your "do { }" block exits, your trafficSpeedLayer is being deallocated, and so the query callbacks have nothing to latch on to when they happen. Cheers, Nick
... View more
09-24-2018
09:38 PM
|
0
|
0
|
3209
|
|
POST
|
Hi. Thanks for the question. Please see if the reply to your other question here resolves the issue for you: https://community.esri.com/thread/221746-query-a-feature-layer-without-adding-the-layer-to-the-map#comment-801385 Nick.
... View more
09-24-2018
08:56 AM
|
0
|
0
|
984
|
|
POST
|
Sounds like you are not holding on to the instance of the layer, so it's going out of scope and being destroyed before the query callback. When you add a layer to the map view, it's being retained by the map view so you're seeing results. Create an object property (rather than a function variable) to hold on to the layer reference and you will get the completion called. You only need to create one instance of the layer and can query it multiple times. You should not create an instance each time your location updates. Sounds like this could be causing the issue in your other question: Querying feature on device location change Nick.
... View more
09-24-2018
08:55 AM
|
0
|
1
|
3209
|
|
BLOG
|
Why are GIS features using one spatial reference whereas the location listener is receiving coordinates in different spatial reference? iOS's CoreLocation returns Lat/Lon, i.e. wgs84 (4326). We can't assume you need it in a specific spatial reference so we don't translate it. But you can use AGSGeometryEngine.projectGeometry() to project it to the route geometry's spatial reference. As for why the route is in Web Mercator (3857): Our major public services (World Geocoder, World Route Task) output in 3857 by default because that matches our default basemaps and so the returned geometries can be overlaid on the map with no extra transformation. If you're working with a different spatial reference in your map, you can specify the AGSRouteParameters.outputSpatialReference property when calling AGSRouteTask.solveRouteWithParameters(). One note: your logic above is likely to always return false though. The chances of the GPS location actually being precisely on the line are vanishingly small. You should buffer around your location by a few meters using AGSGeometryEngine.Buffer() or AGSGeometryEngine.geodeticBuffer() (perhaps adjusting the buffer size by considering AGSLocation.horizontalAccuracy) and check if that buffer polygon intersects with your maneuver line. Or else, as I suggested earlier, measure the distance between the location's point and the maneuver line. Lastly, may I suggest that if you have further questions about this that you post them in the iOS Forums where the community will be more likely to see them? Thanks!
... View more
09-13-2018
08:59 AM
|
1
|
0
|
1586
|
|
POST
|
Hi YunFeng Wu, Are you able to share that data with us? This seems unexpected and we'd like to reproduce the issue. Thanks! Nick.
... View more
09-11-2018
11:47 AM
|
0
|
1
|
967
|
|
POST
|
Are you getting any results, or do all solves fail? I've seen that error when the stops cannot be located on the network (that is to say the network is too far away from the stops). If you're sure the stops are OK (lat/lon the right way around, and spatial reference is correct), then another thought below: Network models have a number of parameters that determine just how the network model is used and to which you make changes and add your stops. I'm not familiar with ArcMap 10.5 and how it configures those parameters, but one thing to check is whether you're using the default parameters as the basis for your runtime requests. One thing to try: once you've created your AGSRouteTask, try calling defaultRouteParametersWithCompletion() and then modifying those parameters with your stops and calling solve from that completion block. See this pattern. Let me know if that helps. Nick.
... View more
09-11-2018
10:17 AM
|
0
|
0
|
1121
|
|
BLOG
|
Hi Manasa Parida. Thanks for the questions. We distinguish the functionality that you're talking about as Navigation vs Routing. The Routing API that we already provide (and which you're making use of) gives you the components you need to get from A to B. But a full Navigation experience that tracks that progress and adjusts the route on the fly and intelligently (such as that provided by the Navigator app) is something you will have to build yourself for the time being. Some high-level thoughts, based off your questions: Using the locationDisplay.locatidHandler is the correct approach to get updates to the user's position. Use AGSGeometryEngine.distanceBetweenGeometry1:geometry2() to calculate the distance of the user's location from the planned route. Perhaps look at the distance between the AGSLocation.position and the AGSDirectionManeuver.geometry to see if the user has moved too far from the route. Consider building some logic to work out which maneuver the user is currently on rather than treating the route as a whole. This can help with cases where the route doubles back on itself, or crosses over itself. By working on a maneuver-by-maneuver basis, you can work out when to read the next maneuver step. E.g. get the end point of the current maneuver, and use GeometryEngine to check when the user has approached within a certain distance of it before reading the next maneuver's text. Realize the limitations of your GPS data. Does the environment cause bad data from time-to-time? How frequently do you get updates (you can control this through the AGSCLLocationDataSource.locationManager in the default case)? And you should probably smooth out bad data rather than allow it to trigger thresholds. Variables like GPS accuracy/quality/frequency or complexity of the route all play into making the work tricky. Nick.
... View more
09-10-2018
09:51 AM
|
1
|
0
|
1586
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | Thursday | |
| 2 | 2 weeks ago | |
| 4 | 4 weeks ago | |
| 1 | 01-29-2026 09:39 AM | |
| 1 | 12-17-2025 10:12 AM |