Thanks for your responce. So the code I used is the following :
for the BaseMap and the Labeled Layer (it's also selectable)
map = new OpenLayers.Map('map',{controls: [new OpenLayers.Control.Navigation(),
new OpenLayers.Control.PanZoomBar(),
new OpenLayers.Control.LayerSwitcher({'ascending':false}),
new OpenLayers.Control.ScaleLine(),
new OpenLayers.Control.MousePosition(),
new OpenLayers.Control.OverviewMap(),
new OpenLayers.Control.KeyboardDefaults()],
numZoomLevels: 30,
projection: mercator,
displayProjection: geographic,
units: "m",
extent: indoor
});
var style = new OpenLayers.StyleMap({
"default": new OpenLayers.Style({
fillColor: "#ff9544",
fillOpacity: 0.9,
strokeColor: "#fc5411",
strokeWidth: 1,
//strokeDashstyle: "dash",
label: "${name}",
// labelAlign: "cc",
fontColor: "#0000",
fontOpacity: 1,
fontFamily: "sans-serif",
})})
var layerLocalisation = new OpenLayers.Layer.Vector("Localisations",{isBaseLayer: false,visibility : true});
var layer = new OpenLayers.Layer.Vector("Bati", {
strategies: [new OpenLayers.Strategy.Fixed()],
styleMap: style,
protocol: new OpenLayers.Protocol.HTTP({
url: "data/gml/bati.xml",
format: new OpenLayers.Format.GML(),
projection: mercator
})
});
var gmap = new OpenLayers.Layer.Google(
"Google Streets", // the default
{numZoomLevels: 30, visibility: false}
);
map.addLayers([gmap,layer,layerLocalisation]);
In a function related to button in my HTML page (function that add a Marker after typing logitude and latitude) :
function locate()
{
var coox = document.getElementById("idlong").value;
//alert(coox);
var cooy = document.getElementById("idlat").value;
var coo1 = new OpenLayers.LonLat(coox, cooy).transform(geographic,mercator);
var point1 = new OpenLayers.Geometry.Point(coo1.lon,coo1.lat);
var featurePoint1 = new OpenLayers.Feature.Vector(
point1,
{ description: 'info' },
{ externalGraphic: 'OpenLayers/img/marker-gold.png', graphicHeight: 25, graphicWidth: 21, graphicXOffset: -12, graphicYOffset: -25 }
);
layerLocalisation.addFeatures([featurePoint1]);
// map.addLayers([vectorLayer1]);
map.setCenter(coo1,18);
}
So the Marker is shown but, it is under the selectabale labeled layer, I hope that I am so clear,