никак не могу заставить появиться popup на моей карте:
Код: Выделить всё
<script type="text/javascript">
Ext.onReady(function() {
var map = new OpenLayers.Map();
var googlemapsatellite = new OpenLayers.Layer.Google("Google Satellite", {type: G_SATELLITE_MAP});
googlemapsatellite.setIsBaseLayer(true);
map.addLayer(googlemapsatellite);
var layers = [
new OpenLayers.Layer.WMS("слой 1", "мой_слой",
{
layers: "мой_слой",
transparent: true
},
{reproject: true},
{
isBaseLayer: false,
buffer: 0
}),
new OpenLayers.Layer.WMS("Слой 2", "мой_второй_слой",
{
transparent: "TRUE",
layers: "мой_второй_слой",
},
{reproject: true},
{
isBaseLayer: false,
buffer: 0
}
)];
var mappanel = new GeoExt.MapPanel({
renderTo: 'gxmap',
height: 600,
width: 750,
map: map,
title: 'Basic Map',
center: [-7.92114,42.90816],
zoom: 8,
layers: layers
});
var tree = new Ext.tree.TreePanel({
renderTo: 'layers',
border: true,
region: "west",
title: "Layers",
height: 600,
width: 250,
root: {},
rootVisible: false,
enableDD: true
});
tree.render(document.body);
var node = new GeoExt.tree.BaseLayerContainer({text: "Base Layers"});
tree.root.appendChild(node);
var node = new GeoExt.tree.OverlayLayerContainer({
text: "Overlay Layers",
expanded: true
});
tree.root.appendChild(node);
node.eachChild(function(child) {
child.ui.toggleCheck(false);
});
var legendPanel = new GeoExt.LegendPanel({
title: "Legend",
renderTo: "legend",
defaults: {
style: 'padding:5px'
},
width: 250,
height: 600,
border: true,
bodyStyle: 'padding:5px'
});
legendPanel.render(document.body);
controls.push(new OpenLayers.Control.WMSGetFeatureInfo({
autoActivate: true,
infoFormat: "text/plain",
maxFeatures: 3,
eventListeners: {
"getfeatureinfo": function(e) {
var items = [];
Ext.each(e.features, function(feature) {
items.push({
xtype: "propertygrid",
title: feature.fid,
source: feature.attributes
});
});
new GeoExt.Popup({
title: "Feature Info",
width: 200,
height: 200,
layout: "accordion",
map: mappanel.map,
location: e.xy,
items: items
}).show();
}
}
}));
});
</script>
По задумке GetFeatureInfo должен выводить данные из слоя shape. Пробовала работать со слоями в QuantumGIS, все получается - данные читаются.
А на веб-карте popup просто не появляется и все, сколько ни кликай!
Если кто-нибудь знаком с GeoExt и сталкивался с подобной проблемой, или кто может предложить другой вариант решения аналогичной задачи, помогите, пожалуйста!