Hi Andreas,
Thanks for the explanation. The problem was that I was using .css 
classes to define the stroke-width, that's why the 

document.getElementById("park_boundary")
.setAttributeNS(null,"stroke-width",myMainMap.curWidth*0.005);

did not work. 
Now it is fine :).
Thanks for the help offer. I have a feeling that I will be needing 
it. 
Regards,
Csorba


--- In [email protected], "Andreas 
Neumann" <[EMAIL PROTECTED]> wrote:
>
> Hi Edith,
> 
> if you use the carto.net navigation tools then you already found an 
> example demonstrating how to scale stroke-width to stay constant 
> after each zoom:
> 
> http://www.carto.net/papers/svg/navigationTools/index.svg
> 
> Note that the national park boundary is scaled after zoom in such, 
> that it always stays at a constant stroke-width.
> 
> The navigation tools of carto.net call the function 
> "loadProjectSpecific()" after each zoom and pan. Within this 
function 
> you can reset stroke-widths. The property myMainMap.curWidth always 
> contains the current width of the maps viewBox, which helps you to 
> calculate stroke-width.
> 
> If you need to change multiple elements, it would be best, to 
> organize all paths with the same stroke-width in a group. This 
allows 
> to set the stroke-width attribute just once at the parent group of 
> the paths.
> 
> If it doesn't work, make sure that the paths elements don't have 
> their own stroke-width already set or that they don't have CSS 
> classes containing stroke-width definitions. If you attach CSS 
> classes to object, they always have precedence.
> 
> Hope this helps,
> 
> If it doesn't provide an example and we will help you.
> 
> Andreas
> 
> PS: SVG 1.2 will have a none-scaling stroke-width attribute as part 
> of the vector effects. This property is even available in the 
mobile 
> profile.
> 
> 
> --- In [email protected], 
> "csorba_edith" <csorba_edith@> wrote:
> >
> > Hi,
> > I would like to ask if anybody knows how it is possible to 
influence
> > the stroke-width when a feature is zoomed in too much. I want to 
> make
> > the stroke of my features descrease proportionally with the zoom 
in 
> rate.
> > I saw the option used in the Yosemite Hiking map:
> > 
> > document.getElementById("park_boundary")
> > .setAttributeNS(null,"stroke-width",myMainMap.curWidth*0.005);
> > 
> > But I did not manage to implement it on my map. I changed the 
> multiple
> > factor (0.005) but it simple has no effect. 
> > Can somebody please explain how it works, or whether there is 
> another
> > solution (demonstrate on a working example maybe).
> > Thank you in advance.
> > Regards
> > Csorba
> >
>






-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to