Page 1 of 1

1.7.5 and GetToolTipFromLayerObject

Posted: Thu Apr 09, 2020 7:49 am
by mhgoddet
Hello,

I try to upgrade xServer.Net on the latest version. I use currently version 1.5.0.
I use the function "GetToolTipFromLayerObject" to change the tooltip description on trucks attributes.
This function has disappeared on the latest version.
How can I do that with version 1.7.5 ?

Re: 1.7.5 and GetToolTipFromLayerObject

Posted: Thu Apr 09, 2020 8:04 am
by Oliver Heilig
Hello,

this code has been removed from inside the control and is now implemented outside. For the current samples look at

https://github.com/ptv-logistics/xserver.net-samples
  • ServerSideRendering - xs-1 RoadEditor, Ti-Loader Layers (deprecated)
  • FeatureLayers - xs-1 FeatureLayers
  • Xmap2LayerFactoryTest - xs-2 FeatureLayers

Re: 1.7.5 and GetToolTipFromLayerObject

Posted: Tue Apr 14, 2020 10:07 am
by mhgoddet
Hello,
I tried the sample FeatureLayers.
It shows truck attributes with tooltips but it's the standard text.
I didn't see how to change the tooltip's text.
Can you help me ?

Re: 1.7.5 and GetToolTipFromLayerObject

Posted: Tue Apr 14, 2020 3:56 pm
by Oliver Heilig
oh, i see.

I will take a look

Re: 1.7.5 and GetToolTipFromLayerObject

Posted: Wed Apr 15, 2020 8:01 am
by mhgoddet
In fact, I use it just to translate the tooltip. I see in the code that the text can be translated automatically.
But I see only Germans translations and I don't know how to set the language.
Maybe it can be easier this way ?

Re: 1.7.5 and GetToolTipFromLayerObject

Posted: Wed Apr 15, 2020 8:05 am
by Bernd Welter
Ah, thanks for the clarification!
Besides the generic question of the post I will ask Oli to provide a sample that translates the tooltip language. Sounds like a proper sticky FAQ ;-)

Re: 1.7.5 and GetToolTipFromLayerObject

Posted: Wed Apr 15, 2020 10:38 am
by Oliver Heilig
If you want to translate the captions for the xs1-FeatureLayer TruckAttributes, this can be done by adding a custom string-table like in this sample:

https://github.com/ptv-logistics/xserve ... mLocalizer

This can be used to translate strings like "Maximal axle load: {0:###,###} kg". A more customized tooltip (e.g. convert to imperial units) would require to override the internal string-builder function.

Re: 1.7.5 and GetToolTipFromLayerObject

Posted: Wed Apr 15, 2020 4:25 pm
by mhgoddet
Thank you.
The sample CustomLocalizer doesnt seems to work. When I change CurrentUICulture, it doesn't change the text. It always take the text in the default language. I don't know why.
But in my application, it works well, so...
And I don't need imperial units and I don't want to need it.

Re: 1.7.5 and GetToolTipFromLayerObject

Posted: Thu Apr 16, 2020 5:49 am
by Oliver Heilig
I have updated the sample yesterday. It contains all current string resources with english text. If you set the CustomLocalizer, the default Resource (regarding the CurrentUICulture) is not used.

You can find the original texts and German translation here https://github.com/ptv-logistics/xserve ... /Resources