[OpenLayers-Users] Openling a kml popup in openlayers

ecuscopuigdellivol ecuscopuigdellivol at hotmail.com
Mon Mar 26 12:10:04 EDT 2012


Hi!

I'm new in this forum and in the webmap developing world (although I'm a
geographer) and I'd like to ask one question; how to open a kml popup in
openlayers. Until now I have this in my JS code:

infoVectorControl = new OpenLayers.Control.SelectFeature(kml
);

map.addControl(infoVectorControl);
infoVectorControl.activate();


kml.events.on({ 
    'featureselected': function(elemento){
	var texto = "Nombre: " + elemento.feature.attributes.NOM + "<br/>";
	popup = new OpenLayers.Popup.FramedCloud("chicken",
          elemento.feature.geometry.getBounds().getCenterLonLat(),
         new OpenLayers.Size(200,200),
         texto,
         null, true);
	},
	'featureunselected': function(elemento){
	},
});

I get the element selection but not the popup (of course I have un attribute
in the kml called "NOM")

Could anyone tell me if there is something wrong? Or where can I be doing
the mistake?

Thank you very much



PS: If It is not the right place to ask this question, please tell me.

Eduard

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Openling-a-kml-popup-in-openlayers-tp4657401p4657401.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list