Boundless SDK提供两种模板。第一种基于OL3和Bootstrap,模板参数分别叫ol3view和ol3edit。另一种基于OL2,GXP,GeoExt,模板参数叫gxp。
使用OpenLayers 3的模板有查看器 (ol3view
)和编辑器 (ol3edit
)
创建查看器应用
创建ol3view类型的myapp应用:
suite-sdk create /path/to/myapp ol3view
suite-sdk debug /path/to/myapp
默认使用OpenGeo Suite中的usa:states
图层.因此需要代理实例.
本地:
suite-sdk debug -g http://localhost:8080/geoserver /path/to/myapp
远程:
suite-sdk debug -g http://example.com/geoserver /path/to/myapp
打开浏览器输入
http://localhost:9080 如下图:
![../../_images/ol3viewer.png](http://127.0.0.1:8080/opengeo-docs/_images/ol3viewer.png)
查看器应用包括如下组件:
- 缩放/拖动
- 图层切换器 底图来自MapQuest (Street Map,Aerial Imagery, and Imagery with Streets) 覆盖层 (States).
- 工具栏
创建编辑器应用
创建ol3edit类型的myapp应用:
suite-sdk create /path/to/myapp ol3edit
suite-sdk debug /path/to/myapp
默认使用OpenGeo Suite中的usa:states
图层.因此需要代理实例.
本地:
suite-sdk debug -g http://localhost:8080/geoserver /path/to/myapp
远程:
suite-sdk debug -g http://example.com/geoserver /path/to/myapp
打开浏览器输入
http://localhost:9080 如下图:
![../../_images/ol3editor.png](http://127.0.0.1:8080/opengeo-docs/_images/ol3editor.png)
编辑器应用包括如下组件:
- 缩放/拖动
- 图层切换器 底图来自MapQuest (Street Map,Aerial Imagery, and Imagery with Streets) 覆盖层 (States).
- 工具栏
- 特征属性表 可以通过双击画点添加新的feature(需要geoserver权限),删除不可用。
自定义开发
修改src/app/app.js
来实现自定义开发。需要借助OL3。