Dynamic switching of mapping services at runtime *including* the possibility to use specific features

Hi,
I have a map in my application using display of TMS layers, which is only available in the openlayers implementation, but I also need to display custom images in my map, which can only be done in the google maps implementation.
I've seen there is the possibility of 'dynamic switching' of the service when using the TMSFNCMaps object. But I cannot 'cast' or transform the map to a different implementation at runtime, can I?

What would you recommend how to handle this most sufficiently?
Ideas:

  • Have two instances of the maps objects and only display one?
  • Create at runtime and throw away the one I am not using and recreate, when in need again?
  • something else?

Thanks!

to be more specific: I do not need to use both features (tms overlays / image overlays) at the same time, hence the idea of switching between both 'modes'.

You will need to create both and then dynamically switch between the two by toggling the Visible property. Alternatively, in the latest TMS FNC Maps implementation we introduced Labels, which can be used in the abstract TTMSFNCMaps class.

Thanks for the quick reply!
re: creating both - would I have to except performance impacts by the double amount of edge threads created etc? That would be my concern.

Can you elaborate a bit more on the labels? How would I make use of them? Or where can I look up how to use them?

Thanks again!

It will create 2 browser instances indeed.

For the labels, you can find a code snippet here:

Basically you can add any HTML to the label and tie it to a coordinate. It's similar to the ElementContainers, but with an easier interface.

Thanks!

re: labels - Ah, I understand.Unfortunately I need to scale the overlay (i.e. a contained image displaying a plan of a construction site of similar) to bounds, so I would need to have the element container be depending on not only a coordinate, but bounds, just as the overlay feature in Google maps works. That is not supported I assume?

Unfortunately not, the bounds mechanism is not included in the abstract labels, but we could introduce that in a future update.

That would be super cool!!
Because it would save me from the hassle of handling two maps instances and so on and so forth.

The expectable question :slight_smile: : Can you estimate (non-binding...) when that could very roughly be available?

I have passed this through to the responsive developer, he will assess this feature and see what is feasible. No time-frame yet, but next week we are planning an update of the whole FNC family and will see if this makes it in the release. If not, then most likely this will be for the next iteration which happens at least once or twice every month.

Cool! Thanks! I will definitely wait for your feedback then before taking any further actions this regard.

Hi Pieter,
could you already clarify with the responsible dev? When do you expect clarification?

I am happy to provide further input if regarded helpful.

Thank you very much!

Hi Simon,

Support for bounds positioning has been added to the Labels feature of the TTMSFNCMaps component. The update is scheduled for release later this week.

This new option is independent of the mapping service so it works and looks the same for all mapping services.
This is an example of how you will be able to display an image in a label positioned inside predefined bounds:

  TMSFNCMaps1.BeginUpdate;
  MapsLabel := TMSFNCMaps1.AddLabel(40.773941, -74.12544, 40.712216, -74.22655, '<img src="https://storage.googleapis.com/geo-devrel-public-buckets/newark_nj_1922-661x516.jpeg" style="position:absolute;width:100%;height:100%;">');
  TMSFNCMaps1.EndUpdate;

Great!
One question about usage: Since I have to work with an TMSFNCOpenLayers instance, beause I need the TMS layers feature: Will I be able to call the addLabel(...) also on the TMSFNCOpenLayers object?

Yes, all features available in TTMSFNCMaps are also available in TTMSFNCOpenLayers.

1 Like

final (stupid?) question: How do I learn from the availability of the release? Will it be mentioned in the newsletter?

Thanks!

The version number and version history will be updated on the product page:

As this will only be a minor update for TMS FNC Maps it is likely it will not be mentioned in the newsletter.

Ok, thanks! I will check the page for versions > 3.6.0.2 frequently then.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Just wanted to let you know the TMS FNC Maps update including bounds positioning support for Labels is now available.

1 Like