Posts

Showing posts from May, 2016

Running ol3cesium using nodejs on desktop

Image
I was trying to run ol3-cesium as a desktop application. I downloaded the latest code with examples from the official site : http://openlayers.org/ol3-cesium/. When I tried opening the main.html (from examples folder) in my web browser..........  And as soon as I hit the enable/disable button view the map in 3D looks like this....... Debug and you will get an error similar to this: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource. How did I solve it? Its a CORS issues and can be solved by using a web server. I used nodejs server to host the directory. Create a server.js file in your ol3-cesium root directory. The content of my server.js: =========== var http = require('http'); var fs = require('fs'); var url = require('url'); // Create a server http.createServer( function (request, response) {    // Parse the request containing file name    var

npm ECONNREFUSED error

If you face error which says ECONNREFUSED while doing npm install <<package name>>, you are probably behind a proxy which is not allowing you to connect to the server and download the packages required. Just follow the below steps: npm config set proxy  http://your_proxy_name:port npm config set https-proxy https://your_proxy_name:port And then try npm install How to get npm config? npm get proxy will do the work :)