1.7.5 and GetToolTipFromLayerObject

Within this forum we want to offer discussions all around our .NET based Map control including all .Net-language specific questions concerning calls of the xServer-API. Attention: xServer-relevant concepts can be found in further forums such as xRoute or xTour.
Post Reply
mhgoddet
Posts: 4
Joined: Wed Apr 08, 2020 3:38 pm

1.7.5 and GetToolTipFromLayerObject

Post 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 ?
User avatar
Oliver Heilig
Posts: 154
Joined: Tue May 13, 2014 12:10 pm
Location: Karlsruhe, Germany
Contact:

Re: 1.7.5 and GetToolTipFromLayerObject

Post 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
Oliver Heilig
Chief Developer Logistic Services
PTV GROUP - Germany

https://github.com/oliverheilig/
mhgoddet
Posts: 4
Joined: Wed Apr 08, 2020 3:38 pm

Re: 1.7.5 and GetToolTipFromLayerObject

Post 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 ?
User avatar
Oliver Heilig
Posts: 154
Joined: Tue May 13, 2014 12:10 pm
Location: Karlsruhe, Germany
Contact:

Re: 1.7.5 and GetToolTipFromLayerObject

Post by Oliver Heilig »

oh, i see.

I will take a look
Oliver Heilig
Chief Developer Logistic Services
PTV GROUP - Germany

https://github.com/oliverheilig/
mhgoddet
Posts: 4
Joined: Wed Apr 08, 2020 3:38 pm

Re: 1.7.5 and GetToolTipFromLayerObject

Post 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 ?
User avatar
Bernd Welter
Site Admin
Posts: 2564
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: 1.7.5 and GetToolTipFromLayerObject

Post 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 ;-)
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
User avatar
Oliver Heilig
Posts: 154
Joined: Tue May 13, 2014 12:10 pm
Location: Karlsruhe, Germany
Contact:

Re: 1.7.5 and GetToolTipFromLayerObject

Post 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.
Oliver Heilig
Chief Developer Logistic Services
PTV GROUP - Germany

https://github.com/oliverheilig/
mhgoddet
Posts: 4
Joined: Wed Apr 08, 2020 3:38 pm

Re: 1.7.5 and GetToolTipFromLayerObject

Post 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.
User avatar
Oliver Heilig
Posts: 154
Joined: Tue May 13, 2014 12:10 pm
Location: Karlsruhe, Germany
Contact:

Re: 1.7.5 and GetToolTipFromLayerObject

Post 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
Oliver Heilig
Chief Developer Logistic Services
PTV GROUP - Germany

https://github.com/oliverheilig/
Post Reply