drawing tools on Mapbox - dictionary

I have added some drawing tools to my Mapbox map using the following code provided on the Mapbox website... https://docs.mapbox.com/mapbox-gl-js/example/mapbox-gl-draw/
I removed anything to do with the area measurement calculation as I only wanted to be able to draw on the map.
However, the map is set to default draw without having to click the drawing icon. This means when the page opens rather than being able to pan around the map the cursor is a crosshair and begins drawing.
I noted the following section in the script but not sure what to put in place of "draw_polygon" to stop it from being the default.
// Set mapbox-gl-draw to draw by default.
// The user does not have to click the polygon control button first.
defaultMode: 'draw_polygon'
});
Anyone have any ideas how to stop draw polygon from being the default?
Also any other ideas on other/better drawing tools?

The default mode is simple_select, so you can either add this in place of draw_polygon, or just remove the defaultMode option altogether and it will start in simple_select mode.

Related

Click events on desktop

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

robotframework - select a region on leaflet map

I'm testing our web application which has a map inside a form. I use leaflet map to show different regions on it, region ids may change with choosing a combo-box option. I've tried click element using Xpath to choose a region but unfortunately it didn't work. Is there any way to select regions from leaflet map with Rrobot Framework?
Below is the Robot Framework code I am using:
click element xpath=.//*[#id='map-id']/div[1]/div[4]/img[89]
Here is my form:
I had the same problem, and there are two ways to fix it: create a custom Python keyword to locate the map element, find the center of the element, calculate a distance away from the center to click, and then click that location (not as hard as it sounds, actually); or click the map element itself (probably by a dom-style locator, those are fairly solid and can click behind transparent overlays) and be happy with the center of the map being the only place you can click it.
Except for the second option, this all assumes that there isn't a transparent overlay blocking Robot Framework from clicking your map, which is something else that could throw that error. If there is, then you may need to go through Javascript via the Execute Javascript keyword. Javascript is able to click things behind transparent overlays, assuming the click () command works with your current setup.
If ALL of that fails, you might consider a different custom keyword that moves the cursor and then clicks as the cursor. I don't have access to that code atm, but it's a one-line keyword in Python.
Also, the error might be just because your XPath wasn't specific enough.

Customising plots in Labview

I have an XY Graph in Labview. I have no problems with its basic functionality.
I'd like to have a marker on the plot (independent on the cursor) which would stay in a certain position that I could read out and display in the GUI. Also I want the user to be able to move the marker to a new position.
How can I implement this functionality?
I know the title isn't very well-chosen, so I'll be grateful for any edits.
Edited:
You can just add cursor.
Add a cursor, select the point style you like and click on Allow dragging as shown on the picture below.
You can modify or read the current position of the point using Cursor Position property of the XY Graph.
They’re called “annotations”; you can add an array of them via a property node.

google maps markers add easeout effect at setMap(null)

I have a Googlemap with multiple markers on that I refresh when moving around or zoom in/out the map. So far so good. The problem is that if a marker is refreshed, I mean repainted on the map, then it blinks for an instance, as it first gets deleted as an old marker and then painted as a new marker. I use setMap(null) to hide markers. Is there a way to avoid this blinking? Is there a way f.e. to add easingout effect at setMap(null) using jQuery or something?
Write your code to not do that. Don't delete all the existing markers, only delete those that no longer appear in the updated data and add new ones.

Highlight point on image map

I am working on imagemap, there are points on my image, I want to mark one of point upon clicking of a button, also please give me idea how can I can control the coordinates because my image is resizeable/dynamic, every time image size will be changed.
http://img191.imageshack.us/img191/1330/imgmaps.png http://img191.imageshack.us/img191/1330/imgmaps.png
Many Thanks for any kind of help.
This seems interesting, but easily possible,
Take and imagebutton control and load your image into it, in the server side click event of it, you will get co-ordintates of the clicked point, you can simply use GDI+ library of .net framework to draw a point on your image.
I hope this helps

Resources