Hi, I just came across this problem again, didnt get time to test it, currently I`m trying to set the radius of point equal to map zoom level. I`m using Geometry.Colection which has a line and point at the end..probably with a triangle graphic.. currently i wanted its radius to be relevant to the zoom level. now my style object is
var radii; // global
function setRadius(){ // this functions gets called everytime the map is
panned or zoomed
try{
radii= map.getZoom();
}
catch(e)
{}
}
var style_line = { // for line
strokeColor: "#FF0000",
fillColor: "#FFFF00",
strokeWidth: 2,
strokeOpacity : 0.8,
strokeDashstyle: "solid",
pointRadius:'${radius}', // here im trying to setting the
radi
graphicName :"triangle",
rotation : ROTATION
};
// this is when i add feature
var lineFeature = new OpenLayers.Feature.Vector(gc,{datetime : "some
text",radius : radii },style_line);
but there is no triangle being drawn.. if i just hard code the pointRadius..
its all good
what am I doing wrong here
regards,
Imran
On Tue, Jun 29, 2010 at 1:32 PM, Sveen Atle Frenvik (Geomatikk IKT) <
[email protected]> wrote:
> On 06/29/2010 10:22 AM, Imran Rajjad wrote:
>
> Hi,
>
> yea thats how I was doing it before openlayers. But there will be a
> different angle for each line. I`m not sure if the stylemap works
> programaticaly.
>
>
> I've tested this approach, and as long as you set the angle/rotation as an
> attribute on the point when you create it (like
> feature.attributes.rotation=20) and then reference it like
>
> rotation: "${rotation}" in the styleMap I think you are good to go
>
> -a
>
> regards,
> Imran
>
> On Tue, Jun 29, 2010 at 1:18 PM, Sveen Atle Frenvik (Geomatikk IKT) <
> [email protected]> wrote:
>
>> Another thing you could do is making a point feature at the end of your
>> line (or line segment), calculate the angle of the line(segment) and then
>> add an external graphic to the point and rotate it according to the angle..
>>
>> did that make sense?
>>
>> -a
>>
>>
>> On 06/29/2010 10:09 AM, Imran Rajjad wrote:
>>
>> Hi,
>>
>> thanks for the link. Though I need to draw arrows on an OpenLayers vector
>> layer , is it possible if I import that sld from the link to openlayers
>> style map.because I`m drawing some patterns and I need to show the
>> orientation aswell.Before using openlayers I was able to do that using
>> native javascript and some drawing library.
>>
>> regards.
>> Imran
>>
>> On Tue, Jun 29, 2010 at 1:05 PM, Kris Geusebroek
>> <[email protected]>wrote:
>>
>>> Hi,
>>>
>>> I don't know which server you use but on the geoserver blog there was an
>>> explanation about this.
>>>
>>> http://blog.geoserver.org/2009/04/02/follow-the-arrows/
>>>
>>> Cheers Kris
>>> Met vriendelijke groet, Kind regards,
>>> * *
>>> *Kristiaan Geusebroek*
>>> Consultant**
>>> * *
>>>
>>>
>>> *
>>> *
>>> Email: [email protected]**
>>> Tel: +31 (0)35 538 1921
>>> Fax: +31 (0)35 538 1922
>>> Mobiel: +31 (0)6 3069 7223**
>>> * *
>>> Utrechtseweg 49
>>> 1213 TL Hilversum
>>> The Netherlands
>>> http://www.xebia.com
>>>
>>> Xebia Blog: http://blog.xebia.com/
>>> Xebia Podcast: http://podcast.xebia.com/
>>>
>>>
>>> On Jun 29, 2010, at 9:44 AM, Imran Rajjad wrote:
>>>
>>> Hi list,
>>>
>>> is it possible to add an arrow which indicates the direction of a
>>> linear feature or line segment. Or is there anyother way to show the
>>> direction of a line feature?
>>>
>>> regards,
>>> Imran
>>>
>>> --
>>> I.R
>>> _______________________________________________
>>> Users mailing list
>>> [email protected]
>>> http://openlayers.org/mailman/listinfo/users
>>>
>>>
>>>
>>
>>
>> --
>> I.R
>>
>>
>> _______________________________________________
>> Users mailing
>> [email protected]http://openlayers.org/mailman/listinfo/users
>>
>>
>>
>> --
>> Atle Frenvik Sveen
>> Utvikler
>> Geomatikk IKT AS
>> tlf: 45 27 86 [email protected]
>>
>>
>
>
> --
> I.R
>
>
>
> --
> Atle Frenvik Sveen
> Utvikler
> Geomatikk IKT AS
> tlf: 45 27 86 [email protected]
>
>
--
I.R
<<ATT5390561.jpg>>
<<ATT5390563.png>>
_______________________________________________ Users mailing list [email protected] http://openlayers.org/mailman/listinfo/users
