Is there a way to intercept the following user gestures, and create a circle on the map?
User clicks mouse on the desired centerpoint and keeps mouse button down.
User extends the radius and lets the mouse button up
Can the API return the geolocation beneath the mouse pointer on mousedown and return the geolocation beneath the mouse pointer on mouseup?
i think this should help -> http://www.imapbuilder.com/gmap-builder/map-editor-user-guide/add_polygon_rectangle_circle_clickable_area.php, maybe also this -> https://developers.google.com/maps/articles/mvcfun
never needed to do this kind of work, but this is where i would start and also google is your number one friend...
Related
Im using aframe for a different purpose than VR. Im using it to show a 3d model where the user can rotate the model, zoom in, out, and inspect various parts of the device on click.
Im using aframe-orbit-controls-component-2 component to make the camera rotate around the device model.
How do I detect mouse clicks on specific parts of the device(I already have these parts with ids, I just need to detect mouse clicks on them) without needing the camera to be focused on said part?
You can use the mouse by setting the cursors attribute rayOrigin: mouse:
<a-scene cursor="rayOrigin: mouse">
....
Check it out here - the console will log the elements which are clicked
When I add click listener for a polyline object, click on it also causes the map click, which I want to avoid, since map click triggers the expensive network operation. How should I subscribe to polyline clicks to avoid map clicks?
You can call stopPropagation() on the event to prevent it from being passed to the polyline hierarchy. See https://developer.here.com/javascript-apis/documentation/v3/maps/topics_api_nlp/h-mapevents-event.html
I have a Map control within my Panorama application.
Since the map is scrollable, it stops the user from swiping to the next screen. The purpose of the map is to capture the user's location and allow the user to move the map around slightly.
Once the user is satisfied with the positioning of the map, I wish to allow the user to swipe to the next screen but this becomes difficult as the map is almost fits in the entire width.
Code:
<phone:PanoramaItem Header="Location">
<maps:Map x:Name="Map" ZoomLevel="7"/>
</phone:PanoramaItem>
Once the user is satisfied with the position you can set IsHitTestVisible to false on the Map control.
Map.IsHitTestVisible = false;
This will prevent scrolling to affect the map control and your panorama will respond to scroll events instead.
I have a Qt application in which certain QLabel's display a tooltip if a certain internal condition occurs.
Since the tooltip has a timeout and is hidden by Qt automatically, the tooltip is kept alive by the application by showing the tooltip every 3 seconds (I did not find any mechanism to tell Qt to show a tooltip indefinitely).
The tooltip is displayed until the user clicks on the QLabel itself: the tooltip is not refreshed any more and disappears.
I now have a new requirement that the tooltip should also disappear if the user clicks on the tooltip itself. Is there a signal that is sent when the user clicks on a visible tooltip? Or is it necessary to use some more sophisticated technique?
EDIT
I have checked my code again, here is some extra information.
Qt does detect a mouse click on a tooltip and hides it, but the application immediately shows the tooltip again.
What I would like to do is that Qt informs my code of the mouse-clicked event, so that it stops showing the tooltip again and again. I have two possible solutions in mind, but I do not know if either of them is technically feasible:
Remove tooltip timeout: when a tooltip is shown, it remains visible as long as the user does not click on it. How can I display a tooltip without a timeout in Qt?
Keep the tooltip visible by repeatedly showing it; detect a mouse clicked on the tooltip in order to stop the keep-alive loop. How do I receive a signal when the user clicks on a tooltip?
Under the hood, the actual class that implements the tooltip is a private QLabel-derived class called QTipLabel:
http://qt.gitorious.org/qt/qt/blobs/4.7/src/gui/kernel/qtooltip.cpp#line119
There's nothing published in the interface to get at an instance of that class from QToolTip, so intercepting clicks would only be done with some sort of ill-advised hack.
That said: among the events that should "hideTipImmediately" is QEvent::mouseButtonPress...in fact, there's an event filter installed so that any click in the app will hide it:
http://qt.gitorious.org/qt/qt/blobs/4.7/src/gui/kernel/qtooltip.cpp#line325
So if you're not seeing the tooltip disappear when it's being clicked on, there's a bug. (Clicking on tooltips hides them for me in Qt-based apps under Kubuntu.)
Note the definition of QToolTip::showText:
void QToolTip::showText ( const QPoint & pos, const QString & text,
QWidget * w, const QRect & rect ) [static] Shows text as a tool tip,
with the global position pos as the point of interest. The tool tip
will be shown with a platform specific offset from this point of
interest.
If you specify a non-empty rect the tip will be hidden as soon as you
move your cursor out of this area.
The rect is in the coordinates of the widget you specify with w. If
the rect is not empty you must specify a widget. Otherwise this
argument can be 0 but it is used to determine the appropriate screen
on multi-head systems.
If text is empty the tool tip is hidden. If the text is the same as
the currently shown tooltip, the tip will not move. You can force
moving by first hiding the tip with an empty text, and then showing
the new tip at the new position.
Thus, you can supply the rectangle in which the QToolTip is to be presented. Then, if what you want to do is close the QToolTip only when the user clicks on it, you can capture mouseButtonPress events as #HostileFork pointed out and then close the tooltip only when the coordinates of the event fall within it.
We have some actions associated with double-click events on a data point inside Flex charts. When user hovers mouse pointer, the mouse datatip is shown properly. However, user needs to double click 'precisely' onto the point, to fire the event correctly. Can we increase 'radius' or 'range' or 'region' or 'target area' of this click event?
PS: Technical details are -
myChart.addEventListener(ChartItemEvent.ITEM_DOUBLE_CLICK, doubleClickHandler);
mychart.dataTipFunction = myDataTipFunction ;
Firefox 3.5
Flex SDK 3.3
Flash Player 10
Please help !!!!
Thanks in advance.
Yes, you can set the mouseSensitivity property on your chart to specify a bounding radius around your data points that flex will use when determining if a point was clicked.
From the docs:
public var mouseSensitivity:Number = 5
Specifies the distance, in pixels, that Flex considers a data point to be under the mouse pointer when the pointer moves around a chart. Flex considers any data point less than mouseSensitivity pixels away to be under the mouse pointer. This value is also used by the findDataPoints method.