[OpenLayers-Users] Problem using SelectFeature control with externalGraphic + rotation

Planet)x andrew.stewart at reddeer.ca
Tue Mar 8 16:23:56 EST 2011


I am using a selectfeature control that works fine (displays data about
point). However I have declared a stylemap like the following with an
external graphic / rotation -

//Traffic Count 
var style_traffic_count =  new OpenLayers.StyleMap({ 
                     "default": new
OpenLayers.Style(OpenLayers.Util.applyDefaults({ 
                         externalGraphic:
"http://localhost/WebServices/images/icons/community_shelter.png", 
                         graphicOpacity: 1, 
                         rotation: -45, 
                         pointRadius: 10 
                     }, OpenLayers.Feature.Vector.style["default"])), 
                     "select": new OpenLayers.Style({ 
                         externalGraphic:
"http://localhost/WebServices/images/icons/community_shelter.png" 
                     }) 

               });    

This works fine, the symbol appears rotated on the map. However now my
select feature control does not work the same. It only works when I hover
the mouse over the original symbol location and it is not taking into
account the rotation of the external graphic. Is there anyway I can fix this
and has anyone run into a similar issue? Appreciate any advice.

Here is my selectfeature control - 

 //Traffic Count Tooltip
    info_traffic_count_tooltip = new
OpenLayers.Control.SelectFeature([layer_TrafficCount], { 
           hover: true, highlightOnly: true, renderIntent: "temporary",
           eventListeners: { featurehighlighted: showTrafficTooltip} 
           });
 
        function showTrafficTooltip(event){
        var feature = event.feature;
        
        var label = feature.attributes.fa_LRS_label;

        if (label == null)
        {
        label = '';
        }

        //Display Tooltip
        tooltip.destroy();
        tooltip_aoi.destroy();
	    tooltip_aoi = new Ext.ToolTip({
        html: label,
        dismissDelay: 3000
        });
        tooltip_aoi.targetXY = [(x_pos + -50),(y_pos - 70)];
        tooltip_aoi.show(); 
        }        

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Problem-using-SelectFeature-control-with-externalGraphic-rotation-tp6143569p6143569.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list