Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

With DrawFeature I'm putting new features to my map. With the hover option of SelectFeature it is possible to get feature information when hovering over it. Now I have the problem of disappearing features on the map when hovering over newly added (=temporary) features?

Any solutions how to style the features so that they stay on the map during storage/editing process?

Here is the relevant code I use styling the point features:

var defaultPoint = new OpenLayers.Style({ label: "D", pointRadius: 8, fillColor: "red", fillOpacity: 0.7, strokeColor: "black", strokeWidth: 3});
var selectPoint  = new OpenLayers.Style({ label: "S",pointRadius: 8, fillColor: "blue", fillOpacity: 0.7, strokeColor: "black", strokeWidth: 3 });
var tempPoint    = new OpenLayers.Style({ label: "T",pointRadius: 8, fillColor: "green",    fillOpacity: 0.7, strokeColor: "black", strokeWidth: 3 }); 

var stylemapPoints = new OpenLayers.StyleMap({'default': defaultPoint, 'select' : selectPoint , 'temporary': tempPoint});

This is the code for the Hover control:

HoverSelectControl = new OpenLayers.Control.SelectFeature([layerName],  
                        { hover:true, 
                          highlightOnly:true, 
                          renderIntent: "select" 
                         }); 
HoverSelectControl.handlers.feature.stopDown = false;
map.addControl(HoverSelectControl);
HoverSelectControl.activate();
share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.