I have added vector layer(features) on the map. when i click on the feature , in the back end it has to take the latlon values and retrieve the data from database(using php) and display the values in the popup. i am able to retrieve the values from the database, but the values are displaying in another page but not in the popup my code is
function createPopup(feature) {
var temp=temponclick(feature.geometry.x ,feature.geometry.y,name);
popup1 = new GeoExt.Popup({
title: 'My Popup',
location: feature,
width:200,
html: temp,
maximizable: true,
collapsible: true,
anchorPosition: "auto"
});
popup1.on({
close: function() {
if(OpenLayers.Util.indexOf(vectorLayer.selectedFeatures,
this.feature) > -1) {
selectCtrl.unselect(this.feature);
}
}
});
popup1.show();
}
vectorLayer.events.on({
featureselected: function(e) {
createPopup(e.feature);
}
});
mapPanel.map.addControl(selectCtrl);
selectCtrl.activate();
function temponclick(x, y,name) {
var url = 'temperature.php?';
var query = 'x=' + x + '&y=' + y+ '&name=' + name;
window.location = url + query;
}
temperature.php
while( $row = mysql_fetch_assoc($result) ) {
echo '<input type="label" id="temp" value="' . $row['temperature'] . '" />';
}
?>