[OpenLayers-Users] TO GeoExt ??
ward
w_ward_W at hotmail.com
Sun Oct 23 02:27:52 EDT 2011
hello all
i need your help
I've done creating a map with popups using OL & Geoserver
how could i convert the code to GeoExt ?
I couldn't find example explains apply google layers
these are parts of my code :
map = new OpenLayers.Map('map', options);
// create Google Maps layer
var gmap = new OpenLayers.Layer.Google(
"Google ###", // the default
{'sphericalMercator': true, numZoomLevels: 20, visibility: true}
);
// create Google Satellite layer
var gsat = new OpenLayers.Layer.Google(
"Google Satellite",
{type: G_SATELLITE_MAP, 'sphericalMercator': true, numZoomLevels: 20}
);
// create WMS layer
var points_pos = new OpenLayers.Layer.WMS(
"Pointss Positions",
"http://localhost:8080/geoserver/wms",
{'layers': 'TEST:points', 'format':'image/png',
'transparent':'true'},
{'opacity': 1.0, 'isBaseLayer': false, 'visibility': true}
);
map.addLayers([gmap, gsat, points_pos );
var featureInfo = new OpenLayers.Control.WMSGetFeatureInfo({
url: 'http://localhost:8080/geoserver/wms',
layerUrls: ["http://localhost:8080/geoserver/gwc/service/wms"],
title: 'Identify features by clicking',
queryVisible: true,
eventListeners: {
getfeatureinfo: function(event) {
map.addPopup(new OpenLayers.Popup.FramedCloud(
"test",
map.getLonLatFromPixel(event.xy),
null,
event.text,
null,
true
));
}
}
});
featureInfo.infoFormat = 'application/vnd.ogc.gml';
featureInfo.events.register("getfeatureinfo", this, pickpointid);
map.addControl(featureInfo);
featureInfo.activate();
function pickpointid(e) {
if (e.features && e.features.length) {
var val = e.features[0].attributes.pos;
document.getElementById('pos').value = val;
}
}
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/TO-GeoExt-tp6921489p6921489.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list