服务器端的SuperCluster

服务器端的SuperCluster

本文介绍了服务器端的SuperCluster的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用 SuperCluster项目可视化 200万标记,我收到此错误:

While trying to visualize 2 million of markers using the SuperCluster project , i get this error :

 Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:///C:/Users/Ahmed/Desktop/supercluster-master/supercluster-master/test/fixtures/taxi2.geojson. (Reason: CORS request not http).

项目负责人告诉我此处,它是 XMLHttpRequest 问题并解决,我需要通过静态服务器保存我的页面.

the Owner of the project told me here that is an XMLHttpRequest Problem and to Solve it i need to serve my page with static server.

所以,因为我之前没有学习过node.js ,所以我搜索了node.js项目在服务器中的使用方式.

So ,since i didn't study node.js before,I searched how node.js projects are used in server.

我发现的是node.js项目需要包含 server.js 文件,而 SuperCluster项目.

what i find is that the node.js project needs to contain server.js file which is missed in SuperCluster project.

我在问如何服务这个项目?

I am asking how is it possible to Serve this project ?

推荐答案

已解决

只需安装 http服务器 node-static (说明此处),然后将您的超级集群项目放在夹具 (节点静态/测试/夹具)上.

just install http-server and node-static (description here), then put your supercluster project on fixtures (node-static/test/fixtures).

在运行之后:

node-static> http-server -p 8000

,然后将浏览器指向: http://localhost:8000/test/fixtures/supercluster-master/demo/

and point your browser to : http://localhost:8000/test/fixtures/supercluster-master/demo/

这篇关于服务器端的SuperCluster的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 04:30