[OpenLayers-Trac] Re: [OpenLayers] #2895: Only one SelectFeatures
in Firefox
OpenLayers
trac-20090302 at openlayers.org
Tue Oct 19 10:17:40 EDT 2010
#2895: Only one SelectFeatures in Firefox
-----------------------------------------------------------+----------------
Reporter: remco | Owner: tschaub
Type: feature | Status: new
Priority: minor | Milestone: 2.11 Release
Component: Control.SelectFeature | Version: 2.10
Keywords: firefox multiple selectFeature selectFeatures | State:
-----------------------------------------------------------+----------------
Comment(by remco):
{{{
var markers = new OpenLayers.Layer.Vector(
"Sensor Markers",
{
styleMap: styleMap,
projection: this.map.displayProjection,
isBaseLayer: false,
reportError: true,
units: 'm',
}
);
markers.setVisibility(true);
this.map.addLayer(markers);
this.activeLayer = markers;
this.layers['markers'] = markers;
// Make buildings polygons clickable
markersSelectControl = new
OpenLayers.Control.SelectFeature(
[markers],
{
multiple: false,
click: true,
}
);
markers.events.on({
"featureselected": function(e) {
ccc.gui.sensorSelected(e.feature.attributes.sensorObject);
},
"featureunselected": function(e) {}
});
this.map.addControl(markersSelectControl);
markersSelectControl.activate();
// TU Delft buildings layer
var buildings = new OpenLayers.Layer.Vector(
"Buildings",
{
projection: this.map.displayProjection,
isBaseLayer: false,
reportError: true,
units: 'm',
strategies: [new
OpenLayers.Strategy.Fixed()],
protocol: new OpenLayers.Protocol.HTTP({
url: "tubuildings.kml",
format: new
OpenLayers.Format.KML({
extractStyles: false,
extractAttributes: true
})
}),
}
);
buildings.setVisibility(false);
this.map.addLayer(buildings);
this.layers['buildings'] = buildings;
// Make buildings polygons clickable
selectControl = new OpenLayers.Control.SelectFeature(
[buildings],
{
multiple: false,
hover: true,
}
);
buildings.events.on({
"featureselected": function(e) {
polyInfo("Building height:
"+e.feature.attributes.height.value+" meter");
},
"featureunselected": function(e) {}
});
this.map.addControl(selectControl);
selectControl.activate();
}}}
--
Ticket URL: <http://trac.openlayers.org/ticket/2895#comment:1>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer
More information about the Trac
mailing list