openlayer 加载wfs 2种方式
2015-06-23 09:47
344 查看
1.geojson
2.KML
url可以在geoserver 中预览视图中得到
var geo = new OpenLayers.Layer.Vector("EarthQuake", { strategies: [new OpenLayers.Strategy.Fixed()], protocol: new OpenLayers.Protocol.HTTP({ url: 'http://172.31.170.98:8088/geoserver/weidong/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=weidong:weidong-vectorlayer&maxFeatures=50&outputFormat=application/json', format: new OpenLayers.Format.GeoJSON({ignoreExtraDims: true}) }) });
2.KML
buildsLayer = new OpenLayers.Layer.Vector('矢量图层', { projection: new OpenLayers.Projection('EPSG:4326'), protocol: new OpenLayers.Protocol.HTTP({ url: 'http://172.31.170.98:8088/geoserver/weidong/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=weidong:weidong-vectorlayer&maxFeatures=50', format: new OpenLayers.Format.GML({ extractAttributes:true }) }), strategies: [new OpenLayers.Strategy.BBOX()] }); var buildsLayer_style = new OpenLayers.Style({ 'fillOpacity': 0, 'fillColor':"yellow", 'strokeColor': 'yellow', 'strokeWidth': 0, 'pointRadius': 8 }); var buildsLayer_style_map = new OpenLayers.StyleMap({ 'default': buildsLayer_style }); buildsLayer.styleMap = buildsLayer_style_map;
url可以在geoserver 中预览视图中得到
相关文章推荐
- Google发布移动网站设计原则
- Apache Shiro介绍
- Powershell 批量替换文件
- Top 10开源的推荐系统简介
- Hadoop集群性能优化一
- 元素位置(offsetLeft[top])
- log4j.properties 详解与配置步骤
- Centos6.6安装zebra
- linux命令- 每日一练(1):ls命令
- Docker 1.7.0 深度解析
- Linux系统编程——Linux系统调用
- 安全认证框架-apache shiro研究心得
- Linux 基金会成立 OCP 开放容器项目
- Linux系统高级编程系列教程
- OpenLayers跨域请求WFS服务在Tomcat环境下的实现cgi
- ecshop退款订单原理分析
- openlayer vectorlayer不显示
- .NET逻辑分层架构总结
- Exchange 日常管理七之:客户端访问服务器高可用部署
- OpenCV之摄像头捕捉图像