[OpenLayers-Users] Offset parameter for named graphic in Feature.Vector

Mark Paxton mark at innaxys.com
Mon Oct 8 03:28:13 PDT 2012


On 08/10/2012 11:10, borlafu wrote:
> I have the exact same issue.
> 
> I'm using a Layer.Vector layer with Feature.Vector features. Those
> features are styled with parameterized StyleMap.
> 
> My features should be represented as pseudo-triangles, with one of
> the vertices on the actual geographic location, and the rest of the
> triangle representing the azimuth. The triangle aperture is not
> important at the moment, but may be useful as well in the future.
> 
> In my use case, most of the times (not always) I'm drawing 3
> features in the exact same location but with different azimuths
> (ie. north, south-east, south-west). I can do it by using an
> external graphic, but I lose the ability to map some other
> parameters to the stroke and fill colors, or the graphic size.
> 
> 
> Here you have an example of use based on the named graphics
> example:
> 
> http://jsfiddle.net/DbCgt/361/
> 
> As you can see, the second named shape is "tricked" to make the
> actual graphic centroid the one I want, but looks really ugly.
> 
> Is there any possibility to add the graphic offset option for
> named graphics?
> 
In the end I just created a new feature and calculated the LonLat
based offset using the Pixel / LonLat conversion on the map. I had to
attach events when the zoom or feature changed, and recalculate each
time, but it does work.

Mark


More information about the Users mailing list