赞
踩
1.geojson
- 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;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。