Is it possible to capture the tap event when we tap on a point marker or a data point? I can see there’s a DataPointSelectionModifier for WPF, but there’s nothing for iOS. Our goal is to show a popup (tooltip) on the point marker when the user taps on it.
Thanks,
Lazar Nikolov
Xamarin.iOS Package Version: 2.2.2.854
The API you are looking for is called the Hit-Test API.
In the latest (sciChart iOS v3) the documentation link is here:
private void HandleSingleTap(UITapGestureRecognizer recognizer)
{
// The touch point relative to the SCIChartSurface
var location = recognizer.LocationInView(recognizer.View.Superview);
// Translate the touch point relative to RenderableSeriesArea (or ModifierSurface)
var hitTestPoint = SciChartSurface.TranslatePoint(location, Surface.RenderableSeriesArea);
// Perform `Hit-Test` which will be stored in the `_hitTestInfo`
renderableSeries.HitTest(_hitTestInfo, hitTestPoint);
}
We also have an example showing how to use the Hit-Test API here. It is Swift but the principles in Xamarin are the same.
Related
Good afternoon, who once worked with heremap sdk premium for ios. How do I make it possible to click on the NMAMapMarker? What they have written in the documentation does not describe it, but maybe I'm wrong.
there are different option available for NMAMapMarker to use.
This represents a marker used to display an icon on a geographical position on a map. The map handles proper placement of icons on the screen as well as panning and rotation.
+mapMarkerWithGeoCoordinates:
+mapMarkerWithGeoCoordinates:icon:
+mapMarkerWithGeoCoordinates:image:
coordinates
icon
draggable
draggingOffsetEnabled
anchorOffset
-initWithGeoCoordinates:
-initWithGeoCoordinates:icon:
-initWithGeoCoordinates:image:
-setAnchorOffsetUsingLayoutPosition:
-setSize:forZoomLevel:
-setSize:forZoomRange:
-resetIconSize
Check for more details : https://developer.here.com/documentation/ios-premium/3.18/api_reference_jazzy/Classes/NMAMapMarker.html#%2Fc:objc(cs)NMAMapMarker(im)initWithGeoCoordinates.
Please revert with your code implementation in case of any further concern.
I'm working on the RN application that has one screen with a list of "drawable" areas in it. So this screen should be scrollable AND drawable.
What I'm trying to do - is to find a solution to distinguish touch events coming from fingers (these will be used to scroll and disallow drawing) and stylus via Apple Pencil (these will be used to draw and disallow scrolling).
In both Gesture Responder and PanResponder there are events being passed on each move. Each of those events (alongside with the nativeEvent) contains the type property. However, it's always null for me in both simulator and device.
Is there any way to recognize a move event as a finger vs stylus?
We had a similar requirement for one of our projects, and what we did was to use a Pressable component, to which a handlePress function was passed as prop.
This function accepted the GestureResponderEvent as event callback argument.
By using the event.nativeEvent.altitudeAngle property that was added recently, we were able to detect Apple Pencil touches.
function handlePress(event: GestureResponderEvent) {
//#ts-expect-error React Native Types do not include altitudeAngle
const isPencilTouch = !!event.nativeEvent.altitudeAngle;
...
}
How to get click event of 3D object rendered using arcore SDK in android studio?
My requirement is to click that 3D object and show pop up dialog.
This has nothing to do with ARCore. The game engine / framework that you are using is actually responsible for that.
For example, if you are using Unity, you can use Raycasting.
RaycastHit hit;
Ray ray = yourARCamera.ScreenPointToRay(Input.GetTouch(0).position);
if (Physics.Raycast(ray, out hit))
{
// Check if what is hit is the desired object
if(hit.tag == "The_Tag_Of_The_Object_You_Are_Looking_For")
{
// User clicked the object.. Do something here..
}
}
Read more here:
https://unity3d.com/learn/tutorials/topics/physics/raycasting
https://docs.unity3d.com/ScriptReference/Physics.Raycast.html
ARCore is not supporting this feature. You need to do it by yourself. Most popular way is ray picking method. There is a lot of examples how to use it
In the case of Arcore - Sceneform SDK, after creating the anchor, you simple have to set a listener on your AnchorNode like so
anchorNode.setOnTapListener((hitResult,motionEvent)->{
//Your pop up
});
I've reviewed the iOS Mapbox SDK and cannot find the equivalent to the Android SDK setOnPolylineClickListener.
The project is using NativeScript (not a problem) so the code will be TS calling the native iOS pieces from the Mapbox SDK.
Current approach:
const shape = MGLShape.shapeWithDataEncodingError(
geo,
NSUTF8StringEncoding
);
const source = MGLShapeSource.alloc().initWithIdentifierShapeOptions(
polylineID,
shape,
null
);
theMap.style.addSource(source);
const layer = MGLLineStyleLayer.alloc().initWithIdentifierSource(
polylineID,
source
);
I can't find anything in the API that allows someone to set a tap/click listener(event) on a shape or layer for iOS. Does the iOS SDK not expose anything similar to Android for this?
Great question! From my answer on GitHub:
You can use -mapView:didSelectAnnotation: to handle taps on a MGLPolyline. This example shows how to add a polyline with our annotations API.
With a MGLLineStyleLayer, you will need to implement a tap gesture recognizer that accesses visible features. See this guide on gesture recognizers for information about built-in gesture recognizers.
How do you remove an arrow from Google Maps geolocation marker (iOS)?
This is an arrow I'm talking about
If you really want to remove that arrow everywhere in your app from Google Maps SDK, it might be easiest to modify asset in GoogleMaps.framework.
Just navigate (cd) to GoogleMaps.framework/Versions/A/Resources/GoogleMaps.bundle/GMSCoreResources.bundle/ and notice the following files:
GMSSprites-0-1x.png
GMSSprites-0-2x.png
GMSSprites-0-3x.png
If you open these files, you can notice the arrow is there. So just edit directly in the asset by replacing arrow by nothing (transparent pixels).
Note: I haven't test it myself and this is not tested solution, but I believe it should work.
Disclaimer: I'm not sure, but I think this modification might violate Terms & Conditions for using the SDK. I don't get any responsibility for such modification, it's your call...
There is no way to do this with current version of the SDK (1.9.1), and actually there is an open issue with this request: Look here.
As a work around, you can hide the default button with:
_map.myLocationEnabled = NO;
Then create a custom GMSMarker
GMSMarker *pointMarker = [GMSMarker markerWithPosition:currentPosition];
pointMarker.icon = [UIImage imageNamed:#"YourImage"];
pointMarker.map = _map;
And change the position of it using a CLLocationManager, so it always show the current position. It's a bit tricky but is the only way, I could think, that you can achieve this. If you need a more complete example let me know.