I am facing a strange behavior using Java script API 4.0. I have two layers to display, one is a tile layer and the other one is a feature layer. When I add the tile layer at the bottom, then I can't zoom in to all levels, but when I add the tile layer at the top every thing goes well but of curse the feature layer will not be visible.
Below is the code that cause the problem:
| var MyFeatureLayer = new FeatureLayer({ | |
| url: "http://*******/MapServer" | |
| }); | |
| var MyTileLayer = new TileLayer({ | |
| url: "http://*******/MapServer" | |
| }); |
| layers: [MyTileLayer, MyFeatureLayer] |
If I changes the order when adding the layers it works, but the tile layer will hide the feature layer:
var map = new Map({
layers: [MyFeatureLayer, MyTileLayer]
});
Any Idea?
Hi there,
You are running to this behavior because the LODs and the min/max scale values come from the 1st layer you add to the map.
I modified the code to remove any scale restriction, but this didn't fix the issue:
var view = new MapView({
container: "viewDiv",
map: map,
constraints: {
minScale: 0,
maxScale: 0
}
});