Mapbox GL - Fullscreen control not working, it is not a constructor - fullscreen

I would like to add the fullscreen control to my map, but for some reason, it doesnt work. I am following tutorial from this link - https://www.mapbox.com/mapbox-gl-js/example/fullscreen/
So to add the FullscreenControl, I use the following code
map.addControl(new mapboxgl.FullscreenControl());
However, it doesnt work, when I compile the project, I see this error in the console - "Uncaught TypeError: mapboxgl.FullscreenControl is not a constructor"
Interestingly, when I use the same code to add the Navigation control, all works as expected.
map.addControl(new mapboxgl.NavigationControl())
Does anyone have an idea where is the problem and why I am able to use that code to add NavigationControl, but not the FullscreenControl?
Thanks a lot

As it was hinted in comments, problem was with the version. I was referencing the older version 0.32.1 . Once I replaced it by version 0.41.0, it started to work

Related

Trying to compile ncat statically gives me errors on nsock dependency

I'm dealing with the following tutorial: https://secwiki.org/w/Nmap/Ncat_Portable but lots of errors are thrown from nsock.
The majority of them are C4430, C2143, and C2238 (I have the IDE in another language so I cannot copy exact messages).
I followed correctly all the steps given from this tutorial and anything seems to work.
I also switch from VS2013 to VS2019, because the v142 build tools were required, but this doesn't seems to do anything new to solve the problem
So can anybody help me with this?

Android studio problem with configuration: type mismatach problem

I wrote a code like that:
var btn: Button = view.findViewById(R.id.btn)
view.findViewById(R.id.btn) is red underlined.
It's working fine but Android studio tolds me that it is mismatch type (Compiler expected View!). It had been working fine until i changed a profile from debug to release. Since that it show me errors.
And one more error which i recived is with:
view.findViewById<TextView>(R.id.user_name)
TextView is red underlined.
No type args expected for fun.
I belive that error s only becouse of android studio config. I can compile my code witout any problem, but android studio doesn't suggest me things like that.
Have you maybe any suggests ?
Have you tried to rebuild and clean your code? #Young_User
Might be an issue with what you are inheriting in your class.
Care to share the error code and full class too?

How can I get WebStorm to recognize the NodeJS module object?

When I am creating a NodeJS module to be exported, the module object is not recognized. Is there a way to get this module object ot be recognized. I looked under the Settings&Framworks > Node and that appears to be correct. Although I can't seem to keep the "Coding assistance for Node.js" checked (it keeps clearing the 'check')
I looked through IntelliJ's Reference Material Here
I actually may be coding incorrectly as well, perhaps I'm not supposed to hook into this 'exports' object in this manor.
Advice and guidance appreciated.
First this question is very similar to This Question
First I went to the settings (Ctrl-Alt-S) and
'Language & Frameworks' > JavaScript > Libraries
Then I hit the Download button till I found a bunch of node libraries. I figured this was a very 'basic' node object so I used the plain 'node' libary.
Then the #types/node was present for me to enable

How to make gnuhawk component AudioSink load to redhawk?

Running CentOS 6.5 and RedHawk 1.9.0, and I have audio-components installed in $SDRROOT, and AudioSink shows up in palette, all good. However when I double click to launch it I get the error:
Launching component AudioSink_1 has encountered a problem
and
Failed to launch: AudioSink_1.
When I click on details I get:
Failed to launch: AudioSink_1
and
IDL:CF/ExecutableDevice/ExecuteFail:1.0
Not very informative. Components AudioSource and AudioTestSource also do not launch.
I was having a very similar issue to what you described when I was trying to use Axios-Engineering's RTLTcpSource component. What the issue was for me was I was installing the component incorrectly. So for me this is how I installed a component in REDHAWK.
Download the original source code. (unzip if necessary)
Open the REDHAWK IDE(eclipse)
File->Import...->Existing Projects into Workspace->next->select the source code folder->Finish
Project->Build Project
Drag project folder to "Target SDR" in the SCA Explorer
I hope this helps you or anyone else. I know there aren't really many places that tell you how to actually add an external component to REDHAWK and it took me a while to figure out to just treat it like a normal custom component.
I had a similar problem when using audiosink. The answer above by JD will work but make sure you re-gen the component since the code was made in 1.84 and there is a new codegen for 1.9.
It may also throw a message saying there are errors when exporting to the target SDR but that can mostly be ignored from my experience.
Similarly if you want more of an output, you can run the component/device through the terminal sandbox after building it and set "-Debug 4" to get more information.
Good luck!
edit: seems like a bug with audiosink was addressed: AudioSink unknown error
you might want to just pull down the updated version and try that!

OpenCV 2.0 C++ API using imshow: returns unhandled exception and "bad-flag"

I'm trying to use the new OpenCV 2.0 API in MS Visual C++ 2008 and wrote this simple program:
cv::Mat img1 = cv::imread("image.jpg",1);
cv::namedWindow("My Window", CV_WINDOW_AUTOSIZE);
cv::imshow("My Window", img1);
Visual Studio returnes an unhandled exception and the Console returns:
OpenCV Error: bad flag (parameter or structure field)
(Unrecognized or unsupported array type) in unknown function,
file ..\..\..\..\ocv\opencv\src\cxcore\cxarray.cpp, line 2376
The image is not displayed. Furthermore the window "My Window" has a strange caption: "ÌÌÌÌMy Window", which is not dependent on the name.
The "old" C API using commands like cvLoadImage, cvNamedWindow or cvShowImage works without any problem for the same image file. I tried a lot of different stuff without success.
I appreciate any help here.
Konrad
As I just commented, imread isn't working for me either. A little googling shows other people having the same problem; I guess it's a bug in the library code. For now, here's a hacky workaround:
IplImage* img = cvLoadImage("lena.jpg");
cv::Mat lena(img);
cvReleaseImage(&img);
This way, you can at least use the C++ API for the rest of your stuff.
There's help for this issue.
The solution is, that the usual proposed opencv library files in the linker are not working properly. Instead try to use the debug library files by this:
In Visual C++:
go to Project->Properties (or Alt-F7)
Configuration Properties->Linker->Input->Additional Dependencies
replace the usual
" cv210.lib cxcore210.lib highgui210.lib" by
" cv210d.lib cxcore210d.lib highgui210d.lib" - which are the debugging libraries.
The OpenCv 2.0 API commands should work now.
I had the same problem described above which turns out to be caused by the settings of the linker.
I found the answer in another thread,
OpenCV 2.3 and Visual Studio 2010.
To repeat it here:
Properties of your project (right click on it)
C/C++
General
include directory add the < your directory >\OpenCV2.3\include\opencv2, < your directory >\OpenCV2.3\include\opencv and < your directory >\OpenCV2.3\include
Linker
General
List item
Input
Add all the libs like opencv_core230d.lib opencv_highgui230d.lib and so on...
Once I've done the above, I can run imshow and imread + all other cpp functions seamlessly! OP's problem has probably already been resolved, but hopefully this will be useful to other people who are led here looking for the same solution.
Are you sure you added the whole path starting from /home/.... I had the same problem as you but when I added the whole path, things work out pretty well. The whole path had to be added despite the fact the path exists in the include files.
imread in openCV unlike Matlab does not return an error when file/folder is not found - instead it returns a null matrix, which in turn is reflected as an error during imshow.
Also, imread does not look for image files in the included folders or the workspace. So, specify the entire path whenever possible.
Please take a note of this for future references.
Firstly, you'd better compile your own version OpenCV.
I had the same error with the build (I got from Sourceforge), and solved by compiling my own version in debug and release versions.
And make sure you change the original system env variable PATH to the new build folder build/bin, then you could build and run the imshow() in Debug mode.
I believe this might be related to unicode.
Try the macro _TEXT()
For example:
cv::Mat img1 = cv::imread(_TEXT("image.jpg"),1);
Unicode in Visual C++ 2

Resources