• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

jdomingu/ThreeGeoJSON: Rendering GeoJSON with three.js

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

jdomingu/ThreeGeoJSON

开源软件地址:

https://github.com/jdomingu/ThreeGeoJSON

开源编程语言:

JavaScript 90.1%

开源软件介绍:

ThreeGeoJSON

IMPORTANT: This project has been retired and does not work with the current version of three.js. Turning this project into something other than the one-off it currently is would require a bit more time than I'm willing to sink in. Thanks to everyone who took an interest.

This project aims to be a simple way to render geojson data in 3D with three.js.

Demo

http://jdomingu.github.io/ThreeGeoJSON/

Note: To view the demo, ensure that your browser supports WebGL rendering.

Instructions

Enter the following code to render a geoJSON file in 3D:

drawThreeGeo(json, radius, shape, {options});   

You can enter the following parameters:

Parameter Description
json The variable that contains the geoJSON that you want to render.
radius The radius of the sphere that you want to render.
shape The 3D shape to use when rendering the geoJSON. Either 'sphere' or 'plane'.
options The threeJS options that you want to use to style the line or particle material.
container Optional. THREE.Object3D instance which will be used as a container for threejson shapes.

For example, you might enter:

drawThreeGeo(json, 10, 'sphere', {
    color: 'green'
}); 

Important Note About Parsing geoJSON

The demo uses the jquery $.getJSON method to pass the geoJSON to the drawThreeGeo function. You can only use this method if the geoJSON is hosted on a server that allows requests for json data. To test this code locally, complete the following steps:

  1. Add var json = to the beginning of the geoJSON file that you want to display.
  2. Change the file extension of your geoJSON file to .js.
  3. Add the json.js file to the head of your HTML page. For example, you might add the following line:
<script src="test_geojson/json.js"></script>



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
gothinkster/flask-realworld-example-app: Exemplary real world JSON API built wit ...发布时间:2022-07-09
下一篇:
JSONVIEW · GitHub发布时间:2022-07-09
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap