setting imageURI for Linesymbol

classic Classic list List threaded Threaded
4 messages Options
TonBrouwer TonBrouwer
Reply | Threaded
Open this post in threaded view
|

setting imageURI for Linesymbol

Hi,

I'm trying to set the imageuri property for a linesymbol as follows :

DefaultStyle.getOrCreate<LineSymbol>()->imageURI() = string("C:\OSGEARTHRUNFILES\pipe2.jpg");

and apply it to the linefeature

FeatureNode* featureNode = new FeatureNode(mapNode, NewFeature, DefaultStyle);


But whatever I try, the lines are not rendered with the image....

I also tried this one without success :
DefaultStyle.getOrCreate<LineSymbol>()->imageURI()->setLiteral("C:\OSGEARTHRUNFILES\pipe2.jpg");

Kind Regards,

Ton Brouwer,
The Netherlands
Reanu Reanu
Reply | Threaded
Open this post in threaded view
|

Re: setting imageURI for Linesymbol

Hi,

I am also interested in doing this.

Did you find a solution eventually ?

Thanks,
Reanu
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: setting imageURI for Linesymbol

In reply to this post by TonBrouwer
Sorry, missed this before. A couple things.

a) use forward slashes in your pathnames in code. Otherwise (on Windows) you need to escape them in a string ("\\").

b) Stroke.imageURI only works for lines with a real-world width (like a width in meters or km). It does not work for pixel-width lines.

Hope this helps.

Note: The forum is no longer accepting new topic posts! Please migrate to the Discussions site.
Glenn Waldron / Pelican Mapping
Reanu Reanu
Reply | Threaded
Open this post in threaded view
|

Re: setting imageURI for Linesymbol

Hi gwaldron,

Thanks for your answer.

I'll open a new post on GitHub Discussions so I can expose my problem better.


Reanu