当前位置: 代码迷 >> GIS >> geoserver顶用OpenLayers添加标记为什么添加不上
  详细解决方案

geoserver顶用OpenLayers添加标记为什么添加不上

热度:197   发布时间:2016-05-05 06:18:40.0
geoserver中用OpenLayers添加标记为什么添加不上
 var bounds = new OpenLayers.Bounds(
                    73.441277, 18.159829,
                    135.08693, 53.561771
                );
                var options = {
                    controls: [],
                    maxExtent: bounds,
                    maxResolution: 0.24080333203125,
                    projection: "EPSG:4326",
                    units: 'degrees'
                };
                map = new OpenLayers.Map('map', options);
                
                var layer = new OpenLayers.Layer.WMS("State", "http://localhost:8080/geoserver/wms", {
                        layers: "cq:prob_region"
                    });
                map.addLayer(layer);
                var markers = new OpenLayers.Layer.Markers("markers");  //这句话错了
                map.addLayer(markers);
  var point = new OpenLayers.LonLat(116.123456,36.123456);
                var size =new OpenLayers.Size(21,25);
                var offset =new OpenLayers.Pixel(-(size.w/2),-size.h);
  相关解决方案