Use tiles basemaps

COM-ADD 5 Reputation points
2024-11-27T13:20:41.2133333+00:00

I have a problem with the configurable basemaps other than the few predefined basemaps.

 

For example, if we want to use

https://tiles.openseamap.org/seamark/{z}/{x}/{y}.png .

 

I try to do the JS:

map.setStyle({

language: 'fr',

style: 'blank'

});

 

map.layers.add(new atlas.layer.TileLayer({

tileUrl: 'https://tiles.openseamap.org/seamark/{z}/{x}/{y}.png',

opacity: 0.8,

tileSize: 256,

minSourceZoom: 7,

maxSourceZoom: 17

}), 'labels');

 

But it doesn't work!

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
746 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. rbrundritt 18,686 Reputation points Microsoft Employee
    2024-11-27T17:24:12.58+00:00

    I just tested the code you provided. It does work. The issue is that the open sea map tiles are not good as a basemap. They are very empty and don't include a background/base map, they only have the additional "sea" overlay data.

    So you will either want to set the map style to something other than "blank", or add another tile layer below the open sea map tile layer.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.