Bonjour,
je voudrais afficher un vector layer que j'alimente "à la main" avec des features
les 2 layers wmsLayer et tch s'affichent bien, mais le layer select ne s'affiche pas.Code:var defaultStyle = new OpenLayers.Style({ 'pointRadius': 3, 'strokeWidth': 2, 'strokeColor': '#0000ff', 'fillColor': '#ffff00' }); var selectStyle = new OpenLayers.Style({ 'pointRadius': 3, 'strokeWidth': 2, 'strokeColor': '#ff0000', 'fillColor': '#ffff00' }); var style = new OpenLayers.StyleMap({ 'default': defaultStyle, 'select': selectStyle }); var select = new OpenLayers.Layer.Vector("vector", { projection: new OpenLayers.Projection("EPSG:4326"), styleMap: style }); var mapOptions = {projection: new OpenLayers.Projection("EPSG:4326"), displayProjection: new OpenLayers.Projection("EPSG:4326"), maxExtent: new OpenLayers.Bounds(-5.0, 45.0, 0.0, 50.0) }; var map = new OpenLayers.Map('map', mapOptions); var wmsLayer = new OpenLayers.Layer.WMS( "vmap0", "http://vmap0.tiles.osgeo.org/wms/vmap0", {layers: 'basic', isBaseLayer:true} ); var tch = new OpenLayers.Layer.WMS( "TCH", "http://monsite.fr:8080/geoserver/wms", {layers: 'monlayer', transparent: true} ); var lonLat = new OpenLayers.LonLat(-4.5,48); select.addFeatures([new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(lonLat))]); map.addLayers([wmsLayer, tch, select]);
Qu'est ce qui cloche ?
Merci,
Nico


Répondre avec citation


Liens sociaux