I'm developing a map on-line using Openlayers. ON that map I have a Vector layer showing restaurants. Each restaurant is represented by an icon which can be click to open a popup in order to display more info. So far so good. But I want to implement an Autocomplete search in Jquery. So What i want to do is when you select a restaurant name in the autocomplete i would like the map to open the corresponding popup (trigger the popup plus center the map and zoom). I manage to center the map but I cannot figure out for the popup openning.
Here the code i'm using for Autocomplete:
$(function() {
$( "#searchresto" ).catcomplete({
delay: 0,
source: "select_resto.php",
select: function ( event, ui )
{
map.setCenter(
new OpenLayers.LonLat( ui.item.h_lon, ui.item.h_lat).transform(
new OpenLayers.Projection(Geo_pjt),
map.getProjectionObject()
), 5 );
},
open: function () {
$( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top");
},
close: function () {
$( this ).removeClass( "ui-corner-top").addClass("ui-corner-all");
}
});});
And that is my Vector layer:
var resto = new OpenLayers.Layer.Vector("GML", {
protocol: new OpenLayers.Protocol.HTTP({
url: "restaurant.php",
format: new OpenLayers.Format.GML(),
}),
strategies: [new OpenLayers.Strategy.Fixed()],
projection: map.displayProjection,
});
Does anyone got an idea how to call the popup in the Jquery function? Or maybe what i'm trying to do is impossible?