Excuse my naiveté, but how do I add markers to a vector layer?
I've been unable to find an example of this.

Currently I'm:

var feature = new OpenLayers.Feature(_markerLayer, lonlat, {});
Feature.icon = icon;
var marker = feature.createMarker();
Marker.events.register("mousedown",feature,markerClick);
_markerLayer.addMarker(marker);


And for my vector features I'm:

var wktFormat = new OpenLayers.Format.WKT();
var feature = wktFormat.read(featureGeom);
feature.id = featureId;
_vectorLayer.addFeatures(feature);


I tried just changing _markerLayer to _vectorLayer but then 
feature.createMarker seemed to fail.


-----Original Message-----
From: Eric Lemoine [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 02, 2008 3:07 AM
To: Heidt, Christopher M.
Cc: [email protected]
Subject: Re: [OpenLayers-Users] Selecting markers and vector features

On Tue, Sep 30, 2008 at 9:51 PM, Heidt, Christopher M.
<[EMAIL PROTECTED]> wrote:
>
> I need to be able to select markers and features without having to 
> make the user select between two different tools.
>
> What's the easiest way to allow a user to transparently interact with 
> features in the markers Layer and the vectors Layer?

Have the markers and features in the same vector layer, and use the select 
feature control. This may not be ideal if you don't want the markers and 
features be in the same layer, but this is the only option you have at this 
point.

Cheers,

--
Eric
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to