I just started testing Cesium after I read all the documentation for getting started with it, but I have a problem:
I downloaded the files (Cesium 1.6 zip)
But when I am open file HelloWorld.html in Firefox (but also in Chrome) it appears an error:
An error occurred while rendering. Rendering has stopped.
SecurityError: The operation is insecure.
p#file:///E:/3D/Cesium-1.11/Build/Cesium/Cesium.js:433:19771
et.prototype.createTexture2D#file:///E:/3D/Cesium-1.11/Build/Cesium/Cesium.js:449:19216
H.prototype.update#file:///E:/3D/Cesium-1.11/Build/Cesium/Cesium.js:434:9598
S.prototype.update#file:///E:/3D/Cesium-1.11/Build/Cesium/Cesium.js:452:1283
m.prototype.update#file:///E:/3D/Cesium-1.11/Build/Cesium/Cesium.js:455:27826
vt#file:///E:/3D/Cesium-1.11/Build/Cesium/Cesium.js:458:15315
Ct#file:///E:/3D/Cesium-1.11/Build/Cesium/Cesium.js:458:18817
bt.prototype.render#file:///E:/3D/Cesium-1.11/Build/Cesium/Cesium.js:458:25057
P.prototype.render#file:///E:/3D/Cesium-1.11/Build/Cesium/Cesium.js:464:4096
t#file:///E:/3D/Cesium-1.11/Build/Cesium/Cesium.js:463:23110
Please solve this problem.
Try to launch it from a local server. Many browsers have different security policies if they load files from file:// or http://
An easy way to launch a local server is use python (on linux or cygwin):
$ cd /path/to/HelloWorld.html
$ python -m SimpleHTTPServer
Related
I have installed the MS4W map server and when I try to launch the site in the localhost it takes me to the below landing page. I am unable to see the map getting loaded in the page.
Any suggestions?
Besides using the setup.exe installer from https://ms4w.com, you can install MS4W manually as well, using the .zip available there; you can use the steps below to verify your installation either way:
make sure that you installed/extracted MS4W into a root of a drive (for example,
you should have a resulting directory structure such as:
C:/
ms4w
Apache
apps
...
open a command prompt window (use Windows search, enter "cmd", and make sure to
choose "Run as Administrator"
now in Command Prompt, enter:
cd c:/ms4w
then setup the MS4W environment with:
setenv.bat
which should let you know that the MS4W environment is ready:
GDAL, mapserv, Python, PHP, and commandline MS4W tools path set
now we can install the Apache web server:
apache-install.bat
which should display a successful message such as (notice the text "The Apache MS4W Web Server service was started successfully") :
Installing the 'Apache MS4W Web Server' service
The 'Apache MS4W Web Server' service is successfully installed.
Testing httpd.conf....
Errors reported here must be corrected before the service can be started.
The Apache MS4W Web Server service is starting.
The Apache MS4W Web Server service was started successfully.
if you have errors, you can check the Apache logs at C:/ms4w/Apache/logs
you can also verify that MapServer is ready at the commandline, with:
mapserv -v
which should display MS4W information such as:
MapServer version 7.6.0-dev (MS4W 4.0.3) OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS SUPPORTS=SVGCAIRO SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS SUPPORTS=POINT_Z_M SUPPORTS=PBF INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
TIP: try to now execute other MS4W tools at that same commandline, such as gdalinfo --formats or shp2img etc. (basically you can call any tool now, that lives in C:/ms4w/tools, without ever having to change directory there)
now you are ready to goto your localhost, so open your web browser (Firefox, Chrome, IE) and type: 127.0.0.1 <enter>
you should see the MS4W homepage now in your local browser, with a sample map as well (that is actually a fully configured WMS service served from your local machine, serving Spatialite data), such as: https://ms4w.dev/
I've installed Transcrypt, compiled the Hello Solar System demo, and run it as instructed using the python web server.
However, I was also able to run the hello.html file directly from Chrome on Windows 10 ... once. Subsequently it refuses to run - the buttons appear but clicking them does not update the text.
------- EDIT ---------
Thanks - CORS is the problem - the browser must connect to a web server, not a file on the local filesystem.
You've probably run into a security policy of Chrome called CORS. Start a webserver from the directory where your html file is, using python -m http.server, and browse to localhost:8000. In your browser window, click on the html file and things should work.
For internal messaging the company I work for uses Slack. It allows for a lot of awesome integration with tons of different software and services. I'm making my own bot for sending webhooks to Slack.
I got everything set up and working, I have a Perl script that sends a JSON payload. If I trigger the script manually, everything works flawlessly and my Slack bot sends messages.
However, when the script gets triggered by Finalbuilder (Software for automatic build processing), it it fails.
I get the following response:
501 Can't load 'C:/Strawberry/perl/site/lib/auto/Net/SSLeay/SSLeay.dll' for module Net::SSLeay: load_file:The specified module could not be found (LWP::Protocol::https not installed)
So I figured I needed to install the "LWP::Protocol::https" module. I just opened my cpan client and wrote install LWP::Protocol::https
Still get the error after installing the module.
I wrote test LWP::Protocol:https, which gave the following response:
Running test for module 'LWP::Protocol::https'
Running make for M/MS/MSCHILLI/LWP-Protocol-https-6.06.tar.gz
Checksum for C:\Strawberry\cpan\sources\authors\id\M\MS\MSCHILLI\LWP-Protocol-https-6.06.tar.gz ok
Scanning cache C:\Strawberry\cpan\build for sizes
............................................................................DONE
CPAN.pm: Going to build M/MS/MSCHILLI/LWP-Protocol-https-6.06.tar.gz
Checking if your kit is complete...
Looks good
Writing Makefile for LWP::Protocol::https
Could not read metadata file. Falling back to other methods to determine prerequisites
cp lib/LWP/Protocol/https.pm blib\lib\LWP\Protocol\https.pm
MSCHILLI/LWP-Protocol-https-6.06.tar.gz
C:\Strawberry\c\bin\dmake.EXE -- OK
Running make test
C:\Strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0,'blib\lib', 'blib\arch')" t/*.t
t/apache.t ....... ok
t/https_proxy.t .. 1/56 # creating cert for direct.ssl.access
# creating cert for direct.ssl.access
# creating cert for foo
# creating cert for bar
# creating cert for foo
# creating cert for foo
# creating cert for bar
# creating cert for bar
t/https_proxy.t .. ok
All tests successful.
Files=2, Tests=61, 8 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU)
Result: PASS
MSCHILLI/LWP-Protocol-https-6.06.tar.gz
C:\Strawberry\c\bin\dmake.EXE test -- OK
I can trigger my script with windows CMD, or Finalbuilder. Both will work just fine, but when the Finalbuilder project gets activated through Continua CI, I get the "can't load ssleay.dll" error.
I have no clue what to do now. Does anyone know how I can fix the Perl error?
I got this same error while running scripts from IDE, but not from command line (same issue).
My command line was adding these to the path. (These were not globally defined).
c:\perl\perl\bin;c:\perl\sup\bin;c:\perl\c\bin;
But the IDE didn't have these. So same fix should work for FinalBuilder, it is missing the perl path information.
Have you loaded the header files? I don't know what they are for Windows but in Linux, they're called: libssl-dev and zlib1g-dev
I also had this error for awhile. In my case the solution was quite simple. It turned out that I hadn't restarted the SVN service, so when it ran the post-commit.bat file the PATH environment hadn't been updated to reflect the new paths that had been added during the Perl install.
While I was testing I was running from a new console window which had the correct PATH, but as soon as it ran from the batch file via SVN it broke, with exactly the same error you posted.
Same problem with IDE Eclipse, command line fine but error with IDE.
I check the location:
C:\>perldoc -l LWP::Protocol::https
C:\zailperl\perl\vendor\lib\LWP\Protocol\https.pm
And I add it to Environments variables.
I didn't want to reboot my PC so I add the parent path to the IDE.
Right click on project.
enter image description here
Is there an option to enable Chrome or the Internet Explorer to load (via ajax-get) an JSON file from the local harddisk?
Firefox does so by default. Internet Explorer says 'premission denied' at the line
request.open(method, url, true);
There are no simple cleaner way you can do this, you have to do some server-side coding.
I suggest you node.js this is very handy for this type of IO operations.
It looks very difficult for first time but it is very handy.
Download and install nodejs.
create a simple project to handle this.
In the directory you want files to get (e.x. D:\myfiles), create one file server.js, content of that js file would be following
var connect = require('connect');
var serveStatic = require('serve-static');
connect().use(serveStatic("./")).listen(105);
open command promp from and get to this directory (D:\myfiles)
Run these two commands npm install connect and npm install serve-static (up to this, is one time process)
Run node server.js - That's all your server is ready and running
call http://localhost:105/<file name> and you can get any files within that directory.
For chrome you can use following command line flags, taken from following question
--allow-file-access-from-files
--disable-web-security
As noted in that question you need to restart your all chrome browsers.
For internet explorer, trick is to use ActiveX version of the XMLHttpRequest object.
See following link.
https://social.msdn.microsoft.com/Forums/ie/en-US/9ae077e0-a7b9-433f-835f-2643aa1a7e09/ie11previewcannot-read-local-files-with-ajax-method-of-jquery?forum=iewebdevelopment
I am using Chrome to test some of my WebGL texture programs. According to the book 'WebGL Programming Guide', if I need to access files from my local disk, I should add the option --allow-file-access-from-files to Chrome.
How do I do that?
The short answer is DON'T
Open up a shell/terminal/command line and type
cd path/to/htmlfiles
python -m SimpleHTTPServer
Then in your browser to go
http://localhost:8000
If you find it's too slow consider this solution
The reason you don't want to allow file access is allowing it can be used to steal data from your machine. For example, you go to a site and download some webpage. You then view that page locally. With file access on that locally run page can now access all your files AND upload them to a server.