Not all MapStyles in merge style are working in SDK for Web v6

I am playing around with the v6 beta of the Maps SDK for Web. I am unable to get all the map styles in merge style method working.

For instance: incidents_dark results in a white container with only copyright. And the settings for poi=poi_main has the same result. With the poi=poi_main the debugger Is see a 404-error (Requested style \"poi_main\" could not be found.). The default setting only works when you remote the poi=poi_main.

"https://api.tomtom.com/style/1/style/20.3.2-*? map=basic_main&traffic_incidents=incidents_day &traffic_flow=flow_relative0&poi=poi_main"

Am I missing something, or is this beta thingy? After all it is a beta. :wink:

I test my map with a very simple static javascript.

  tt.setProductInfo('<your-product-name>', '<your-product-version>');
  tt.map({
      key: key,
      container: 'map',
      style: 'https://api.tomtom.com/style/1/style/20.3.2-3?map=basic_night-lite&traffic_incidents=incidents_day&traffic_flow=flow_reduced-sensitivity',
      center: [location],
      zoom: 11,
      stylesVisibility:{
					trafficFlow: true,
					trafficIncidents: true
      }

Hi,

I am sorry for your inconvenience. I checked and it seems to be a bug in style/style merger endpoint’s behaviour. Please, either try to use different style version or wait for a fix.

Thanks,
Bartek

2 Likes

These style queries work as expected, please, check these:

New style uses “poi_main” name:
https://api.tomtom.com/style/1/style/20.3.4-*?map=basic_main&traffic_flow=flow_relative0&poi=poi_main&traffic_incidents=incidents_day&poi=poi_main

Older style uses name “basic_poi”:
https://api.tomtom.com/style/1/style/20.3.2-*?map=basic_night-lite&traffic_incidents=incidents_day&traffic_flow=flow_reduced-sensitivity&poi=basic_poi

There’s no poi_main style available in versions 20.3.2-* of the style assets.

You can always see what assets are available in given version with following calls:
https://api.tomtom.com/traffic/map/4/style/20.3.2-*/metadata.xml?key=<YOUR_API_KEY>

and

https://api.tomtom.com/map/1/style/20.3.2-*/metadata.xml?key=<YOUR_API_KEY>

Thanks. I can wait for a fix.I use beta and should therefore accepting these risks.

About the poi style. I took the style from the documentation. Perhaps I used an old copy past, but the style is now written as 20.3.4-* One issue less. :slight_smile:

I am glad that it helped.
Please, use the newest style, then you don’t need to wait for any changes to the older hosted assets.
The documentation is updated with the newest style information (as we did the SDK release meanwhile), so other users won’t run into the same problem. Good luck.

2 Likes