Hi everyone,
I made a patch file for feature labels based on the SVG-textpath element. Right now, only half of the work is done. Only the SVG Renderer is supported, so make sure you use Firefox. As I said earlier, I have some problems using textpaths in VML. This patch also includes an example, based on the modify-feature example. Here you can try and see the modify- and rotate-controls in action. I hope you like it. greets Dominik -------- Original-Nachricht -------- > Datum: Mon, 15 Feb 2010 11:07:49 +0100 > Von: "Dominik Gärner" <[email protected]> > An: [email protected] > Betreff: Re: [OpenLayers-Dev] feature label enhancement > > > > I tried to do this at one point. Because OL ties a single SVG/VML object > > to a > > single geometry, it was hard to do right, so I gave up after spending a > > couple > > weekends on it. Good luck. :) > > > Where were the problems? I think the label SVG/VML object is also tied to > this geometry!? > > Right now, I'm creating a textpath instead of the textbox element. I had > no problems doing this with SVG, so far. > My problem is (as always -.-) doing the same thing for IE. For some reason > the textpath in VML is not working... And for some other reason there is > in OL a flipping of VML-objects around the y-axis... > > > Regards > > > > Datum: Mon, 15 Feb 2010 09:27:15 +0100 > > Von: "Dominik Gärner" <[email protected]> > > An: [email protected] > > Betreff: Fwd: Re: [OpenLayers-Dev] feature label enhancement > > > > > > > ------- Weitergeleitete Nachricht ------- > > Von: "Christopher Schmidt" <[email protected]> > > An: "Dominik Gärner" <[email protected]> > > Kopie: [email protected] > > Betreff: Re: [OpenLayers-Dev] feature label enhancement > > Datum: Wed, 10 Feb 2010 14:11:22 +0100 > > > > On Wed, Feb 10, 2010 at 11:29:48AM +0100, "Dominik Gärner" wrote: > > > Hi everyone, > > > > > > I'd like to do some label enhancement for vector features. I want the > > > label to follow the feature shape (e.g. see > > > http://www.svgbasics.com/text2.html ) > > > It shouldn't be that hard by using SVG & VML. However, since this > means > > > some changes in the Renderers - and I'm not so familiar with the whole > > > > existing implementations - I need some ideas & help for creating a > > > concept: > > > > > > - using SVG, a textpath needs a <path> element. In SVG i could link > the > > > text to the path element (using the xlink:href attribute), but > currently > > > > > only Polygon and Curve geometries are using <path> node types. And I'm > > > > not sure if VML allows links. > > > The better way will be to create a separate path element for the > > > text/label, using the feature's geometry (--> this means changes to > the > > > drawText methods in the Renderers) > > > > > > - maybe some additional style attributes for the label have to be > added. > > > > > > - Who knows something about Canvas? Is it possible to implement curved > > > > text like in SVG & VML? > > > Where or which component decides what to use (besides of IE->VML, > > > Firefox->SVG) > > > > I doubt it. > > > > > - Rotating labels comes for free by rotating the vector feature. Does > it > > > > > make sense to create an extra Label/Text class for placing just labels > > > > (e.g. if I want to place just a text, not a feature with a label > > > attribute) > > > > No, because you can use a feature with no strokeWidth/strokeColor (an > > invisible > > feature) if you really want to do that. > > > > > - Did I forget something essential? Sees anyone bigger blockades for > the > > > > > programming of this? > > > > I tried to do this at one point. Because OL ties a single SVG/VML object > > to a > > single geometry, it was hard to do right, so I gave up after spending a > > couple > > weekends on it. Good luck. :) > > > > Regards, > > > > > _______________________________________________ > Dev mailing list > [email protected] > http://openlayers.org/mailman/listinfo/dev -- NEU: Mit GMX DSL über 1000,- ¿ sparen! http://portal.gmx.net/de/go/dsl02
labeltextpath_SVGonly.patch
Description: Binary data
_______________________________________________ Dev mailing list [email protected] http://openlayers.org/mailman/listinfo/dev
