Lines with markers (was Moderator action)

> Markus Nilsson (ECS) [mailto:Markus.Nilsson@ecs.ericsson.se] wrote:
> 
> I'm working with maps, and am looking for a convenient way to 
> create line patterns. With a line pattern, I refer to for 
> example a shape such as a circle reoccurring at specified 
> intervals along the line. 
> If I have understood it correctly it is not possible to use 
> the pattern element used for surfaces to create this effect, 
> and I do not want to insert the symbols manually using coordinates.
> Markus Nilsson
> 

It would seem the best approach for you would be to add the markers through a script executed at load time.

For example, if you used a specific class for your circle'd lines:

<g class="lineWithCircles">
	<line x1="0" y1="0" x2="100" y2="100"/>
</g>

You could have a script search through the document looking for that class and then add child circle elements to the group at the desired spacing.  The DOM would be as big as if your document was:

<g class="lineWithCircles">
	<line x1="0" y1="0" x2="100" y2="100"/>
	<circle cx="0" cy="0" r="1"/>
	...
	<circle cx="100" cy="100" r="1"/>
</g>

But you wouldn't need to calculate those points on the server or transmit them over the wire.

p.s. svg-developers@yahoogroups.com might be a better forum to ask these types of usage questions as www-svg@w3.org seems more focused on comments on the SVG recommendation.

Received on Thursday, 1 March 2001 15:41:11 UTC