|
POST
|
I fixed my problem by adding one second to the time and using >=. EditDate >= TIMESTAMP '2018-11-17 23:29:35' It seems like this should be more intuitive though.
... View more
11-20-2018
05:24 AM
|
1
|
0
|
1818
|
|
POST
|
In my mobile app (in Swift), I query a feature service in ArcGIS Online. My where clause looks like this: EditDate > TIMESTAMP '2018-11-17 23:29:34' My results include records with EditDate equal to the timestamp. I have printed the six returned features' EditDates to the console to make sure I wasn't missing something. They all printed this: "2018-11-17 23:29:34 +0000". Is this a bug in the query routines? Does the EditDate field hold the fraction of the second when the edit actually took place? If so, is there a way for me to access the fractional part in a query?
... View more
11-19-2018
02:52 PM
|
0
|
9
|
2065
|
|
POST
|
I am trying to implement the <AGSGeoViewTouchDelegate> protocol to use the didTouchDownAtScreenPoint method to tell AGSMapView to ignore my own touch-and-drag gesture recognizer, which is used for drawing pencil strokes in the map. By testing, I have discerned some of the functionality, but I still have to guess at the rest. Here is what I have learned: If I omit didTouchDownAtScreenPoint, all touch input that is not captured by my drag gesture recognizer (and some that is) gets recognized by the AGSMapView, even if I have previously set interactionOptions.isEnabled = false. If I implement didTouchDownAtScreenPoint but never call the provided completion block, AGSMapView captures no touches, which is the behavior I want. But the problem is that the next touch, which is intended for AGSMapView interaction, is ignored. So it appears the completion block is the key. Because it is @escaping, I can hold onto the completion block for execution later, like when my gesture recognizer's drag is complete. Calling it with completion(true) when my drag is complete works great and almost solves the problem. However, I still don't know what to do with second-finger touches that may occur during my first-finger drag gesture. Through testing, I see that second-finger touches also call didTouchDownAtScreenPoint with their own completion blocks. For now, I am guessing I should keep all the completion blocks I receive in an array until I finish my gesture, and then call each of them with completion(true) in the order I received them. This also appears to work but it sure doesn't feel right. I have no idea if I am causing other problems by doing it this way. The only documentation I can find is in the reference. And the only example I can find is in Viewshed (location). Neither the reference nor the example show anything about touch events coming from a second finger during the drag of the first. I am wondering if there is more documentation somewhere describing how the completion block should be used in more complex cases such as mine. By the way, if I can use this way to tell AGSMapView to stop taking touch input, it might solve the problem I was describing in an older thread.
... View more
09-18-2018
07:23 AM
|
0
|
0
|
827
|
|
POST
|
I thought I had this fixed with my "in-the-weeds" fix I posted at the beginning of this thread. However, a new related problem is now happening. Even though I am setting interactionOptions.isEnabled = false and disabling all the gesture recognizers, something is hooking into some (not all) of my drag points and misinterpreting them as zoom. What's weird is, the misinterpretation is something I wouldn't know how to do in AGS, even if I wanted to. Stroking down zooms in, stroking up zooms out, and stroking left or right has no effect. What I need is simple. I need to disable AGSMapView user interaction completely during my stroke. That is, as soon as my StrokeGestureRecognizer is triggered, I need a way to disable all user interaction with the rest of the map view. Have you been able to reproduce this problem? Thanks, Worth
... View more
09-13-2018
02:50 PM
|
0
|
5
|
2400
|
|
POST
|
I just transitioned my code to KVO on autoPanMode and it works great. It isn't as elegant as autoPanModeChangedHandler but it makes an awesome workaround for until the fix comes. Thanks Phil. Worth
... View more
07-17-2018
12:06 PM
|
1
|
0
|
845
|
|
POST
|
After updating my project with 100.3, my autoPanModeChangedHandler is no longer called. I made a test app with basically the same swift code from the [ArcGIS Runtime SDK Samples]->[Display device location] and it doesn't fire there either. Does anyone know if the way we should use autoPanModeChangedHandler has changed?
... View more
07-13-2018
08:18 AM
|
0
|
2
|
966
|
|
POST
|
Thanks, I'll try that and report back here. I'll bet that works.
... View more
02-13-2018
03:02 PM
|
0
|
0
|
756
|
|
POST
|
In case anyone needs a workaround, this is what worked for me. It is crude, I know. But it works even on an iPhone 5s, which is the slowest device my app will run on. self.map = AGSMap(item: portalItem)
self.map?.load {_ in
// Even after the map load has completed, self.map is not ready
// for any locationToScreen calls yet.
Timer.scheduledTimer(withTimeInterval: 0.5, repeats: false) {_ in
// But after waiting half a second, in all my tests, it is ready.
// The following line triggers sketchView.draw(CGRect), which
// calls this mapView's locationToScreen several times in pursuit
// of sketch stroke transformations.
self.sketchView.setNeedsDisplay()
}
} I'm not too keen on relying on a Timer for the solution. I'm hoping someone can tell me a better way.
... View more
02-04-2018
02:11 PM
|
0
|
2
|
756
|
|
POST
|
My app displays spatially accurate graphics in a view on top of the mapView. To do so, I perform on-the-fly transformations for the graphics from within viewpointChangedHandler. Sometimes on first load, some of the graphics don't show on the screen where they should. After much debugging, I have discovered that even though the mapView.map has been loaded, calling mapView.locationToScreen() returns a CGPoint where both x and y are NaN, CGPoint(x: nan, y: nan). The map is already AGSLoadStatusLoaded. But obviously, I'm trying to do this too soon. What trigger or observable on the mapView or mapView.map can I use to know when mapView.locationToScreen is ready to return good screen coordinates?
... View more
02-02-2018
03:27 PM
|
0
|
3
|
1205
|
|
POST
|
My app is logging in with a named user so I have a portal and a user (AGSPortal and AGSPortalUser). I want to list for the user all the web maps he or she has access to within their organization but not all the publicly available web maps out there. Here is what I've figured out: user.fetchContent - gets the user's own items portal.findItems(with: AGSPortalQueryParameters) - get all items meeting query, including freely open and available items. Is there a way to configure AGSPortalQueryParameters to return only all the items the user has access to in the organization? Or even better, is there a direct way to get the organization items?
... View more
01-13-2018
04:45 PM
|
0
|
1
|
658
|
|
POST
|
Later, when I'm not so deep in other code, I might can make a sample program that demonstrates the problem. But for now, I'll just try to explain it better. I instantiate my StrokeGestureRecognizer, which subclasses UIGestureRecognizer, when the user raises the pencils to go into edit mode. I add it to my MapView, which is a subclass of AGSMapView. When the user begins a stroke, triggering strokeGestureRecognizer, the following action is called: func strokeUpdated(_ strokeRecognizer: StrokeGestureRecognizer) {
let workingStroke: WorkingStroke?
if strokeRecognizer.state != .cancelled {
workingStroke = strokeRecognizer.workingStroke
if strokeRecognizer.state == .began ||
(strokeRecognizer.state == .ended && mapViewModel.activeWorkingStroke.value == nil) {
mapViewModel.activeWorkingStroke.value = workingStroke
}
} else {
workingStroke = nil
mapViewModel.activeWorkingStroke.value = nil
}
if let workingStroke = workingStroke {
if strokeRecognizer.state == .ended {
if strokeRecognizer.isForApplePencil {
// Make sure we get the final workingStroke update if needed.
workingStroke.receivedAllNeededUpdatesBlock = { [weak self] in
self?.mapView.sketchView.setNeedsDisplay(for: workingStroke)
workingStroke.clearUpdateInfo()
}
}
mapViewModel.takeActiveWorkingStroke(mapView: mapView)
mapViewModel.activeWorkingStroke.value = nil
}
}
if let activeWorkingStroke = mapViewModel.activeWorkingStroke.value {
mapView.sketchView.setNeedsDisplay(for: activeWorkingStroke)
}
}
We want to disable map interaction only if the user is making a stroke. On Line 7 above, activeWorkingStroke is instantiated so it can begin taking touch samples. In the view controller, an observer is triggered whenever activeWorkingStroke changes: mapViewModel.activeWorkingStroke.asObservable()
.subscribe(onNext: { [weak self] activeWorkingStroke in
if activeWorkingStroke == nil {
self?.mapView.interaction(isEnabled: true)
} else {
self?.mapView.interaction(isEnabled: false)
}
}) The following is the version of my MapView member function that used to work: func interaction(isEnabled: Bool) {
self.interactionOptions.isEnabled = isEnabled
}
But somewhere along the way, it stopped working. Xcode, iOS and AGS have each gone through some recent updates so It is hard to say exactly when this problem began. The following is how I fixed it: func interaction(isEnabled: Bool) {
self.interactionOptions.isEnabled = isEnabled
guard let gestureRecognizers = gestureRecognizers else { return }
for gestureRecognizer in gestureRecognizers {
if let panGestureRecognizer = gestureRecognizer as? UIPanGestureRecognizer {
panGestureRecognizer.isEnabled = isEnabled
} else if let pinchGestureRecognizer = gestureRecognizer as? UIPinchGestureRecognizer {
pinchGestureRecognizer.isEnabled = isEnabled
} else if let rotationGestureRecognizer = gestureRecognizer as? UIRotationGestureRecognizer {
rotationGestureRecognizer.isEnabled = isEnabled
}
}
}
My gesture recognizer, strokeGestureRecognizer, is added to the mapView object, the same object where all the AGS gesture recognizers reside. Is it possible my gesture recognizer has tripped up some code somewhere that assumes all the gesture recognizers are Esri's? Or, perhaps it is something Apple did that is tripping both of us up. When I get a chance, I'll verify the bug is still there by retrying the old interaction(isEnabled:) function. For now, I'm happy leaving my fix in place. I just wanted you all to know about the problem and, if nothing else, recheck your code to verify it still works as intended for more normal use cases. Thanks for the help.
... View more
01-12-2018
03:17 PM
|
1
|
7
|
2400
|
|
POST
|
...if another gesture is already in progress. Or at least that is how the problem appears to me. My app is Draw GIS (similar to Draw Maps in the App Store). It allows the user to freehand draw in the web map. To do so in my code, I add a gesture recognizer to capture drawing strokes. When a stroke begins, I have to disable mapView.interactionOptions. This used to work in earlier versions but somewhere along the way this stopped working. To get around the problem, I disable/enable the mapView's pan, pinch, and rotate gesture recognizers directly. class MapView: AGSMapView {
...
func interaction(isEnabled: Bool) {
self.interactionOptions.isEnabled = isEnabled
guard let gestureRecognizers = gestureRecognizers else { return }
for gestureRecognizer in gestureRecognizers {
if let panGestureRecognizer = gestureRecognizer as? UIPanGestureRecognizer {
panGestureRecognizer.isEnabled = isEnabled
} else if let pinchGestureRecognizer = gestureRecognizer as? UIPinchGestureRecognizer {
pinchGestureRecognizer.isEnabled = isEnabled
} else if let rotationGestureRecognizer = gestureRecognizer as? UIRotationGestureRecognizer {
rotationGestureRecognizer.isEnabled = isEnabled
}
}
}
...
} I hope this helps someone.
... View more
12-15-2017
08:41 AM
|
1
|
9
|
2958
|
|
POST
|
I am preparing our app for iPhone X, which makes use of the new safeAreaLayoutGuide to keep controls above iPhone X's bottom indicator for accessing the Home screen. Currently, AGSGeoView.attributionTopAnchor falls below UIView.safeAreaLayoutGuide.bottomAnchor. Two questions: Is there a change planned for Esri attribution with respect to iPhone X? What is the best way in code to position an app's controls above both anchors (AGSGeoView.attributionTopAnchor and UIView.safeAreaLayoutGuide.bottomAnchor) for all device types and orientations?
... View more
10-19-2017
01:33 PM
|
0
|
1
|
772
|
|
POST
|
I use KVO to observe AGSMapView.drawStatus. Is there any way to distinguish between drawStatus changes caused by panning and zooming from those caused by locationDisplay? I am using drawStatus to know when to register undo actions in UndoManager. Unfortunately, this keeps clearing my redo stack if I have locationDisplay started. I hope I find out I'm just missing something. Is there a better trigger to use for user pan and zoom events?
... View more
06-20-2017
01:26 PM
|
0
|
0
|
810
|
|
POST
|
Until it is ready, I've changed my code to maintain an affine transform of my graphics and superimpose it in another view. It works well enough for now. Thanks for getting back to me. I look forward to seeing it in a future release.
... View more
06-19-2017
01:59 PM
|
0
|
2
|
1722
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-28-2019 01:37 PM | |
| 1 | 11-20-2018 05:24 AM | |
| 1 | 02-22-2019 03:35 PM | |
| 1 | 07-17-2018 12:06 PM | |
| 1 | 01-12-2018 03:17 PM |
| Online Status |
Offline
|
| Date Last Visited |
12-06-2022
09:55 PM
|