|
From: Manos K. <mk...@di...> - 2011-01-12 22:50:34
|
Hi all!
I am currently developing an app exposing numerous layers on an OpenLayers
map.
The majority of them are exposed and queried successfully with the use of a
GeoServer installation on a remote server (I am mentioning this because the
proxy doesn't seem to be my problem).
However, some of the layers I am exposing are plain kml-encoded vectors. In
their case, the code I am using displays different behavior depending on
where I deploy it.
To be more specific, my SelectFeatureListeners work correctly ONLY when the
code is deployed in the AppEngine and loaded on Chrome. On the other hand,
on any other browser, while these features are property visualized and I can
select them, no event is triggered from their selection.
The same goes when I deploy my app in tomcat.
A snippet of my code is the following:
KML responseFormat = new KML();
kmlLayer.addFeatures(responseFormat.read(kmlText));
mapWidget.getMap().addLayer(kmlLayer);
queriesAndKML.put(cb.getText(), result.get(0));
SelectFeatureOptions kmlSelectOpts = new SelectFeatureOptions();
SelectFeature kmlSelect = new SelectFeature(kmlLayer, kmlSelectOpts);
kmlSelectOpts.onSelect(new SelectFeatureListener() {
@Override
public void onFeatureSelected(VectorFeature vectorFeature) {
System.out.println("Clicked indeed");
FramedCloud cloud = new FramedCloud("Custom Query",
vectorFeature.getCenterLonLat(), new Size(300,300), new
KML().write(vectorFeature) , new Icon("", new Size(0,0), new
Pixel(0,0)),true);
map.addPopup(cloud);
}
});
mapWidget.getMap().addControl(kmlSelect);
kmlSelect.activate();
Using a ClickFeatureListener didn't make any difference, there was no
improvement.
Am I missing something??
Thanks,
Manos
|