Adding a layer in Openlayers returns error

المشرف العام

Administrator
طاقم الإدارة
I am trying to understand why the following simple code of adding a layer in openlayers gives an error (adds the layer in layer switcher but everything gets pink):

//alert(layerName); var indexLayer = layerName.indexOf(":"); var layerName = layerName.substring(indexLayer+1); //alert(layerName); var workspace = 'esoteriko:'; var layerName2 = workspace.concat(layerName); alert(layerName2); //esoteriko:nodesdistributionhubnetwork1 // ADD THE LAYER OPENLAYERS wms_layer_larisa2 = new OpenLayers.Layer.WMS( layerName,"http://localhost:8080/geoserver/gwc/service/wms", //http://192.168.2.6:8080/geoserver/wms { "layers": layerName2, "format": "image/png", "transparent": true, "version": "1.1.1", "tiled": true }, { format: "image/png", displayOutsideMaxExtent: false, projection: new OpenLayers.Projection("EPSG:900913"), } ); map.addLayer(wms_layer_larisa2); }Am I missing something obvious?



أكثر...
 
أعلى